scieee AI-readable full text Open interactive document viewer

Estimating macroeconomic models of financial crises: An endogenous regime-switching approach

Benigno, Gianluca,Foerster, Andrew,Otrok, Christopher M.,Rebucci, Alessandro

Abstract

EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.

Full text

Benigno, Gianluca; Foerster, Andrew; Otrok, Christopher M.; Rebucci, Alessandro Article Estimating macroeconomic models of financial crises: An endogenous regime-switching approach Quantitative Economics Provided in Cooperation with: The Econometric Society Suggested Citation: Benigno, Gianluca; Foerster, Andrew; Otrok, Christopher M.; Rebucci, Alessandro (2025) : Estimating macroeconomic models of financial crises: An endogenous regime-switching approach, Quantitative Economics, ISSN 1759-7331, The Econometric Society, New Haven, CT, Vol. 16, Iss. 1, pp. 1-47, https://doi.org/10.3982/QE2038 This Version is available at: https://hdl.handle.net/10419/320330 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by-nc/4.0/ Quantitative Economics 16 (2025), 1–47 1759-7331/20250001 Estimating macroeconomic models of financial crises: An endogenous regime-switching approach Gianluca Benigno Department of Economics, University of Lausanne and CEPR Andrew Foerster Economic Research Department, Federal Reserve Bank of San Francisco Christopher Otrok Research Department, Federal Reserve Bank of Dallas Alessandro Rebucci Carey Business School, Johns Hopkins University, ABFER, CEPR, and NBER We develop a new model of cycles and crises in emerging markets, featuring an occasionally binding borrowing constraint and stochastic volatility, and estimate it with quarterly data for Mexico since 1981. We propose an endogenous regimeswitching formulation of the occasionally binding borrowing constraint, develop a general perturbation method to solve the model, and estimate it using Bayesian methods. We find that the model fits the Mexican data well without systematically relying on large shocks, matching the typical stylized facts of emerging market business cycles and Mexico’s history of sudden stops in capital flows. We also find that interest rate shocks play a smaller role in driving both cycles and crises than previously found in the literature. Keywords. Business cycles, Bayesian estimation, endogenous regime-switching, financial crises, Mexico, occasionally binding constraints, sudden stops. JEL classification. C11, E3, F41, G01. 1. Introduction The global financial crisis triggered a strong renewed interest in understanding the causes, consequences, and remedies of financial crises. In this context, dynamic Gianluca Benigno: [email protected] Andrew Foerster: [email protected] Christopher Otrok: [email protected] Alessandro Rebucci: [email protected] We are grateful to three anonymous referees, Yan Bai, Dario Caldara, Luca Guerrieri, Yoosoon Chang, Pablo Guerron-Quintana, Yasuo Hirose, Giorgio Primiceri, Felipe Saffie, and Frank Schorfheide for helpful comments on previous drafts of this paper and discussions. We also thank participants at numerous seminars and conferences. Sanha Noh provided outstanding research assistance. The authors gratefully acknowledge financial support from NSF Grant SES1530707 and the Johns Hopkins Catalyst Award. The views expressed are solely those of the authors and do not necessarily reflect the views of the Federal Reserve Banks of Dallas, San Francisco, or the Federal Reserve System. ©2025 The Authors. Licensed under the Creative Commons Attribution-NonCommercial License 4.0. Available at http://qeconomics.org.https://doi.org/10.3982/QE2038 2Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) stochastic general equilibrium (DSGE) models with occasionally binding financial frictions or stochastic volatility proved successful as laboratories for studying the anatomy of both business cycles and crises and exploring optimal policy responses to these dynamics. This success is because occasionally binding financial frictions are mechanisms that create an amplification of regular business cycle dynamics. At the same time, a now large literature has shown that uncertainty modeled as stochastic volatility also contributes to cycles and crises, capturing fat tails and skewness in the data. The structural estimation of these models is important for inference on key parameters governing financial frictions and exogenous processes and the decomposition of important historical episodes, yet it is very challenging. In this paper, we develop a new model of cycles and crises in emerging markets, featuring an occasionally binding borrowing constraint and stochastic volatility, and estimate it with quarterly data for Mexico since 1981. The paper makes three contributions. First, we propose a new specification of the occasionally binding collateral constraint that permits matching crises of different durations and intensities. Second, we develop a perturbation solution method suitable for solving models like ours in a way that allows for likelihood-based estimation. Third, we apply the proposed framework to investigate sources of business cycles and crises in Mexico since 1981—a case studied most often as a typical emerging market economy. As a first step, we propose a new formulation of occasionally binding constraint models. As in the traditional specification of such models, our setup has two states or regimes: in the first, limited leverage amplifies regular shocks and gives rise to fire sales and debt-deflation dynamics; in the second, access to financing is unconstrained, and the economy displays regular business cycles. However, in our specification, the transitions between the two regimes depend on a range rather than a unique level of leverage, with endogenous switching probabilities that are a function of the borrowing capacity of the economy and the multiplier associated with the leverage constraint. This formulation maps the model with an occasionally binding leverage constraint into an endogenous regime-switching model. The paper focuses on a particular constraint and type of crisis, the so-called sudden stop in capital flows, but the proposed specification has broader applicability to other types of occasionally binding constraints and frictions. For example, our proposed approach could be applied to the formulation and estimation of models with housing constraints, downward wage rigidity, or the zero lower bound. Next, we develop a perturbation-based solution method to solve the endogenous regime-switching model. The perturbation method is fast enough to permit likelihoodbased estimation, is scalable to models larger than the one we estimate in this paper, and displays typical levels of accuracy. We also analytically show that approximating the model solution to the second order is necessary and sufficient to capture at least some of the effects of the endogenous transition probabilities on the model’s policy functions, including precautionary behavior, and that these effects would be missed by linear approximations or exogenous regime switching models. The second-order solution also allows us to capture the effects of regime shifts in the volatility of exogenous shocks. Again, the solution method that we develop can be applied to a wide range of models with endogenous regime-switching. Quantitative Economics 16 (2025) Estimating models of financial crises 3 Figure 1. Current account and GDP in Mexico, 1981–2016. Note: Panel (a) plots Mexico’s current account balance as a share of GDP. Panel (b) shows Mexico’s quarterly log-change of real GDP. The light gray regions denote the periods of currency or external debt crisis according to Reinhart and Rogoff (2009), which we call the External Crisis Tally Index. See the Supplementary Appendix (Benigno, Foerster, Otrok, and Rebucci (2024)) for data sources. Sample period 1981:Q1-2016:Q4. Finally, we apply the framework that we developed to the Bayesian estimation and analysis of Mexico’s history of cycles and sudden stop crises since 1981. The Mexican economy is a particularly interesting laboratory because many of the seminal contributions to the literature on business cycles and crises in emerging markets previously studied this case. Figure 1plots two critical Mexican data macroeconomic series: the current account balance as a share of GDP and the quarterly real GDP growth. The figure also indicates as (gray) shaded areas Mexico’s periods of currency and external debt crisis identified in Reinhart and Rogoff (2009). The figure illustrates the regular fluctuations in the data, as well as the multiple episodes of large current account reversals and output growth declines. Large current account reversals and output drops of heterogeneous size and persistence are the two main empirical features commonly associated with sudden stops in capital flows, not only in Mexico but also in many other emerging markets. In this paper, we focus on the challenge of fitting a structural model to Mexico’s business cycle and sudden stop history without imposing ad hoc restrictions on the magnitude or persistence of these episodes. The figure also displays the marked shift in the volatility of the economy both before and after the mid-1990s and during certain periods of time, which may not be captured by an occasionally binding borrowing constraint or financial shocks. Despite the econometric challenges in characterizing data like those shown in Figure 1, our estimated model fits Mexico’s business cycles and sudden stop episodes well, without systematically relying on large shocks to explain crises, but instead letting 4Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) the economic structure of the model explain those events. The inclusion of stochastic volatility helps us to distinguish between the binding constraint and periods of more volatile shocks as drivers of fluctuations. The model produces business cycle statistics that match the second moments of the data and yields evidence that neither productivity nor interest rate shocks are the most important drivers of Mexico’s business cycles. Most importantly, our specification of the collateral constraint identifies crisis episodes and dynamics of varying duration and intensity that match the crisis periods identified with a narrative approach in Reinhart and Rogoff (2009). Related literature Our paper is connected to several strands of literature. The paper relates to the large literature on the Bayesian estimation of DSGE models (e.g., Schorfheide,2000,Otrok, 2001,Smets and Wouters,2007,Iacoviello and Neri,2010,Bianchi,2013). We extend that successful approach to models with occasionally binding collateral constraints, which have become the benchmark for normative analysis of macro-prudential optimal policy. Our paper is closely related to the empirical work in Bocola (2016), where the model is solved with global methods and estimated. However, that estimation exercise is made possible by first estimating the model outside the crisis, and then appending an estimate of the crisis in a second step. While this procedure does not matter for the specific application in Bocola (2016), it is not necessarily applicable more generally. Our approach permits joint estimation of the model inside and outside the crises and is potentially scalable to larger and more complex models, while maintaining a satisfactory level of accuracy relative to global solution methods. The paper is also closely related to the literature on likelihood-based estimation of Markov switching DSGE models initiated by the seminal contribution of Bianchi (2013), andappliedinBianchi and Ilut (2017)andBianchi, Ilut, and Schneider (2018). The filter we use in estimation differs in two key respects. First, our regime-switching transition matrix is endogenous. Second, conditional on the regime, we solve the model to the second order. So, we employ the Sigma Point Filter to evaluate the likelihood function in place of the modified Kalman filter in Bianchi (2013). In the literature on Markov-switching DSGE models, our paper builds on the method proposed by Foerster, Rubio-Ramirez, Waggoner, and Zha (2016), who developed perturbation methods for the solution of exogenous regime-switching models. The perturbation approach that we propose allows for secondand higher-order approximations that go beyond the linear models studied by Davig and Leeper (2007)andFarmer, Daniel, Waggoner, and Zha (2011). In fact, we show that at least a second-order approximation is necessary in order to capture the effects of the endogenous switching. The paper is naturally related to the literature that focuses on endogenous regimeswitching models. Davig and Leeper (2008), Davig, Leeper, and Walker (2010), and Alpanda and Ueberfeldt (2016) all consider endogenous regime-switching but employ global solution methods that hinder likelihood-based estimation. Lind (2014) develops aregime-switching perturbation approach for approximating nonlinear models, but it requires repeatedly refining the points of approximation, and hence, it is not suitable for estimation purposes. Quantitative Economics 16 (2025) Estimating models of financial crises 5 Here, our paper relates closely to OccBin, a set of procedures for the solution of models with occasionally binding constraints, developed in Guerrieri and Iacoviello (2015). OccBin is a certainty equivalent solution method that captures nonlinearities but not precautionary effects, which are a critical feature of models with occasionally binding collateral constraints.1A key feature of our approach is to preserve precautionary saving effects, as agents in the model adjust their behavior due to the presence of the constraint even when the constraint does not bind, and vice versa. The specification of the inequality constraint and the accompanying solution method that we propose can be applied to models with occasionally binding zerolower bound on interest rates (e.g., Adam and Billi (2007), Aruoba, Cuba-Borda, and Schorfheide (2018), Atkinson, Richter, and Throckmorton (2018)).2Existing methods for the estimation of such models may limit scalability due computational costs (Gust, Herbst, Lopez-Salido, and Smith (2017)). The approach we propose is scalable and applicable to large models. The application of the methodology that we propose relates to the literature on emerging market business cycles, which includes Aguiar and Gopinath (2007), Mendoza (2010), Garcia-Cicco, Pancrazi, and Uribe (2010), Fernandez-Villaverde, GuerronQuintana, Rubio-Ramirez, and Uribe (2011), among others. Encompassing most shocks previously considered, we consider transitory and permanent technology, preference, expenditure, interest rate, and terms of trade shocks in our analysis. We allow for regime switching in the volatility of shocks as in (Liu, Waggoner, and Zha (2011), Bianchi (2013)) since stochastic volatility has been shown to be an important feature of emerging markets data (Fernandez-Villaverde et al. (2011)). Relative to Mendoza (2010), we provide a Bayesian estimation of the model and consider a wider set of structural shocks. Relative to Garcia-Cicco, Pancrazi, and Uribe (2010), we empirically evaluate the relative importance of interest rate shocks by modeling the amplification induced by financial frictions with an occasionally binding borrowing constraint. The rest of the paper is organized as follows. Section 2describes the model and discusses the proposed formulation of the collateral constraint and stochastic volatility. Section 3presents our perturbation solution method for endogenous regime-switching models. Section 4describes the Bayesian estimation procedure and reports the estimation results. Section 5discusses the main empirical results on the analysis of Mexico’s business cycle and history of sudden stop crises. Section 6concludes. Technical details and additional results are reported in the Appendix and in the Supplementary Appendix (Benigno et al. (2024)). 2. The model The framework is a medium-scale model for the analysis of business cycles and suddenstop crises in emerging market economies. The model is a small, open production econ1Cuba-Borda, Guerrieri, Iacoviello, and Zhong (2019) study how the solution method and likelihood misspecification interact and possibly compound each other. 2An occasionally binding zero-lower bound is not comparable to the constraint with endogenous collateral value that we estimate in this paper. Indeed, endogenous collateral valuation features different amplification mechanisms and entails additional computational complexities. 6Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) omy as in Mendoza (2010) with endogenous labor supply, investment, and an occasionally binding collateral constraint. We consider a large set of shocks as in GarciaCicco, Pancrazi, and Uribe (2010), including permanent and temporary productivity shocks (Aguiar and Gopinath (2007)), intertemporal preference, expenditure, interest rate, and terms of trade shocks. The model also features stochastic volatility in all shocks (Fernandez-Villaverde et al. (2011)). In the rest of this section, we briefly state the optimization problem of the representative household-firm and then discuss the specification of the borrowing constraint and the shock processes, which are the novel features of our model. The derivation of the equilibrium conditions and the formal definition of the competitive equilibrium of the economy are in Appendix A. 2.1 Preferences, constraints, and shock processes There is a representative household-firm that maximizes the following utility function: U=E0 ∞  t=0dtβtCt−Zt−1 Hω t ω1−ρ −1 1−ρ,(1) where Ctdenotes consumption and Htthe supply of labor. The utility depends on an exogenous and stochastic preference shock dt, and the permanent technology level Zt−1, which follow the processes specified below.3The household-firm chooses consumption, labor, capital Kt, imported intermediate inputs Vtgiven an exogenous stochastic for their relative price Ptalso specified below, and holdings of real one-period international bonds, Bt. Negative values of Btindicate borrowing from abroad. The household-firm can borrow in international markets by issuing one-period bonds that pay a market or country net interest rate rt. The household-firm faces the following budget constraint: Ct+It+Et=Yt−φrt(WtHt+PtVt)−1 (1+rt)Bt+Bt−1,(2) where Ytis gross domestic product (GDP) given by Yt=AtKη t−1(ZtHt)αV1−α−η t−PtVt.(3) Here, Atdenotes a stationary, exogenous, and stochastic level of technology, and Ztis a non-stationary, exogenous, and stochastic level of technology. Etis an exogenous and stochastic expenditure process possibly interpreted as a fiscal or net export shock as in Garcia-Cicco, Pancrazi, and Uribe (2010). The term φrt(WtHt+PtVt)describes a working capital constraint, stating that a fraction of the wage and intermediate goods bill must be paid in advance of production with borrowed funds. The relative price of labor and 3Scaling hours worked by Zt−1permits obtaining a balanced growth path with GHH preferences (see, e.g., Garcia-Cicco, Pancrazi, and Uribe (2010)). Quantitative Economics 16 (2025) Estimating models of financial crises 7 capital are given by Wtand qt, respectively, both of which are endogenous but taken as given by the individual household-firm. Capital accumulation depends on investment Itand is subject to adjustment costs: Kt=(1−δ)Kt−1+It−ι 2Kt−kKt−1 Kt−12 Kt−1,(4) where kdenotes the growth rate of capital along the economy’s balanced growth path (BGP). All exogenous processes have stochastic volatility, depending on a regime indicator sσ t∈{H,L},whereHand Lsignify a high and low volatility regime, respectively, as in Liu, Waggoner, and Zha (2011)orBianchi (2013), among others. The preference process follows logdt=ρdlogdt−1+σdsσ tεd,t.(5) The stationary technology process follows logAt=(1−ρA)logA∗+ρAlogAt−1+σAsσ tεA,t.(6) The permanent technology process follows logZt=(1−ρz)logZ∗+ρzlogZt−1+σzsσ tεz,t.(7) The interest rate process follows rt=(1−ρr)r∗+ρrrt−1+σrsσ tεr,t.(8) The process for the relative price of intermediate goods follows logPt=(1−ρP)logP∗+ρPlogPt−1+σPsσ tεP,t.(9) Finally, the process for the exogenous component of expenditure follows Et=et/Zt−1, where loget=(1−ρe)loge∗+ρeloget−1+σesσ tεe,t. (10) The starred variables and the ρcoefficients denote the unconditional mean values and the persistence parameters of these processes, respectively. The εare assumed i.i.d. N(0, 1)innovations, and the σparameters control the size of their variances. The transition matrix of the volatility regimes, Pσ, is exogenous and given by Pσ=Pσ LL 1−Pσ LL 1−Pσ HH Pσ HH , where Pσ ij =Pr(sσ t+1=j|sσ t+1=i). 8Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) 2.2 The occasionally binding borrowing constraint: An endogenous regime-switching specification As in typical models with occasionally binding inequality constraints, the economy fluctuates between two states or regimes. In one state, denoted sc t=1 and called the binding or constrained regime, the following constraint on total borrowing binds strictly: 1 (1+rt)Bt−φ(1+rt)(WtHt+PtVt)=−κqtKt, (11) with λtdenoting the corresponding multiplier. Total debt includes borrowing for consumption smoothing plus working capital for the purchase of intermediate inputs and labor for production. Constrained working capital limits the supply response of the economy to shocks in the binding regime. In the other state, denoted sc t=0 and called the nonbinding or unconstrained regime, the borrowing limit is slack and λt=0, and the only constraint is the natural debt limit. Given these two regimes, which represent the occasionally binding nature of the constraint, we characterize the transition between them stochastically in the sense that, for given values of capital, bond holding, and exogenous processes, there is an endogenous probability of switching between the two regimes. This formulation contrasts with the deterministic relationship between leverage and the regime for given values of endogenous and exogenous state variables in a typical occasionally binding specification. In particular, we assume that the probabilities of switching from one regime to the other follow a logistic function of a restricted subset of the endogenous state variables in the model.4 Define the “borrowing cushion,” B∗ t, as the distance of actual borrowing from the debt limit: B∗ t=1 (1+rt)Bt−φ(1+rt)(WtHt+PtVt)+κqtKt, (12) so that when B∗ tis small, total borrowing and leverage are high relative to the value of the collateral. We then assume that the transition from the nonbinding to the binding regime depends on ˜ B∗ t=B∗ t/Zt−1according to Prsc t+1=1|sc t=0, ˜ B∗ t=exp−γ0˜ B∗ t 1+exp−γ0˜ B∗ t. (13) Thus, the likelihood that the constraint binds in the following period depends on the size of the borrowing cushion in the current period.5The parameter γ0controls 4This is similar to the logistic specification in Bocola (2016), where the economy switches between default and nondefault states. Kumhof, Rancière, and Winant (2015) also use a logistic function to model the transition to the default regime in the context of a positive analysis of the relationship between financial crises and inequality. Davig, Leeper, and Walker (2010) and Bi and Traum (2014) use a similar logistic formulation to study the macroeconomic consequences of fiscal limits. 5Appendix Cshows that this timing difference with respect to a model with a traditional inequality specification of the occasionally borrowing constraint does not affect the first and second moments of the economy. Quantitative Economics 16 (2025) Estimating models of financial crises 15 Our solution method is fast, and readily scales to handle larger models. In total, we have 20 equilibrium conditions, two endogenous and six exogenous state variables, four regimes,andsixshocks.Themodelissolvedinaboutasecondonastandardlaptop. 13 As Appendix Cdiscusses in more detail, the proposed solution method is also accurate. We investigate its accuracy by applying it to the calibrated model in Mendoza and Villalvazo (2020) and comparing our endogenous regime switching specification solved by perturbation with the traditional inequality constraint specification solved with global methods. We compare the first and second moments for all model variables and show that our solution method yields results practically indistinguishable from those obtained from a traditional inequality specification of the borrowing constraint. Specifically, we find Euler equation errors in line with the accuracy of perturbation methods applied to exogenous regime-switching models (Foerster et al. (2016)) and models without regime-switching (Aruoba, Fernandez-Villaverde, and Rubio-Ramirez (2006)). We also document a solution speed more than 800 times faster than the global method. Indeed, this solution speed gain is what makes likelihood-based estimation of the model feasible. 3.4 Approximation order and endogenous switching Our endogenous regime-switching framework must be solved at least to the second order to capture the effects of the endogenous switching on the policy rules, which include precautionary effects that vary with the state of the economy. If we were to approximate only to the first order, we would not capture the precautionary behavior stemming from rational expectations about the dependency of the probability of a regime change on the borrowing cushion and the multiplier. The following proposition states this result formally. Proposition 1 (Properties of the approximated solution). The first-order approximation to the endogenous regime-switching model is identical to the first-order approximate solution of an exogenous regime-switching model in which the transition probabilities are given by the steady-state value of the time-varying transition matrix.A second-order approximation to the endogenous regime-switching model is necessary and sufficient to capture precautionary effects of the endogenous switching. Proof. See Appendix B. This result is analogous to stating that, in models without regime-switching, a firstorder solution is invariant to the size of the shocks, a second-order solution captures 13A MATLAB code for the proposed solution algorithm is available on the authors’ web pages. For this paper, our computational approach is similar to that in Fernandez-Villaverde, Guerron-Quintana, and RubioRamirez (2015). We use Mathematica to take symbolic derivatives and export these derivatives to C++. We then integrate them in Matlab using mex files to solve the model for different parameterizations. In principle, we could solve and estimate the model using only C++ or FORTRAN, but the gains in terms of speed would be relatively minor; for larger models, these languages might yield more substantial efficiency gains. Since we use a nonlinear filter, the filtering in estimation, not the model solution, is the most timeconsuming computational step. 16 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) precautionary behavior, and a third-order solution is needed to capture the effects of stochastic volatility that follows an autoregressive process as in Fernandez-Villaverde, Guerron-Quintana, and Rubio-Ramirez (2015). In our context, since we have exogenous regime changes in volatility, a second-order approximation is sufficient to capture precautionary effects associated with volatility changes (Foerster et al. (2016)). In our setting, the shocks to the volatility processes of a stochastic volatility specification manifest themselves as discrete changes in the volatilities and not as shocks to the processes themselves. Unfortunately, however, using a second-order approximation with endogenous regime-switching poses additional challenges for estimation purposes. We now turn to our strategy to address these issues. 4. Estimating the endogenous switching model We estimate the model with a Bayesian full information procedure. The posterior distribution has no analytical solution, and we use Markov-Chain Monte Carlo (MCMC) methods to sample from it. Since the Metropolis–Hastings algorithm we use for sampling is standard, we omit the discussion of this step in our procedure. A critical challenge in posterior sampling is the evaluation of the likelihood function. We face three difficulties relative to linear DSGE models (e.g., Smets and Wouters (2007)). The first is the nonlinearity induced by the presence of multiple regimes. The second is the need to approximate to the second order. The third is the fact that the transition probabilities are endogenous. Bianchi (2013) develops an algorithm to address the first difficulty. Here, we must deal with the second-order approximation and endogenous probabilities in a tractable manner. One alternative is the Particle Filter (Fernandez-Villaverde and Rubio-Ramirez (2007)). However, the regime switching leads to the discarding of a large number of simulated particles, lowering the accuracy for a given number of particles and greatly increasing the computational cost of reaching accuracy (Doucet, Gordon, and Krishnamurthy (2001)). To address these challenges, we use the Unscented Kalman Filter (UKF) with Sigma Points (Julier and Uhlmann (1999)). The Sigma Point filter has been shown to be an efficient way of estimating regimeswitching models (Binning and Maih (2015)). Details of the construction of the state space representation and the filtering for the evaluation of the likelihood are reported in the Supplementary Appendix (Benigno et al. (2024)). 4.1 Observables, data, and measurement errors We estimate the model with quarterly data for GDP growth (gross output less intermediate input payments), consumption growth, investment growth, and intermediate import price growth, as well as the current account-to-GDP ratio, and a measure of the country real interest rate.14 14See the SA for details on variable definitions and data sources. The country interest rate is constructed following Uribe and Yue (2006), and it is the US 3-Month Treasury Bill minus ex post US CPI inflation rate plus Mexico’s EMBI Spread. Quantitative Economics 16 (2025) Estimating models of financial crises 17 As there are six shocks with six observables, we do not necessarily need measurement errors. However, measurement errors in the observation equation improve the performance of the nonlinear filter and account for any actual measurement error in the data. As in Garcia-Cicco, Pancrazi, and Uribe (2010), we limit their variance to 5% of the variance of the observable variables. As a consequence, the model will fit the data relatively closely on average, and model fit or lack thereof will be assessed by checking whether it relies on large shocks to generate crisis episodes and by comparing our model with alternative specifications. 4.2 Calibrated parameters and prior distributions Our objective is to estimate the critical parameters governing dynamics in both the binding and nonbinding regimes. We calibrate a subset of model parameters listed in Table 1 on which we have strong prior information from the existing literature, including particularly Mendoza (2010), who calibrated them based on the stylized facts of Mexico’s National Accounts at an annual frequency. Our model is calibrated and estimated at a quarterly frequency. The SA provides details on the calibration of these parameters. For the estimated parameters, we set two types of prior. The first is directly on the parameters. These priors are listed in Table 2. They are relatively diffuse, only imposing sign restrictions or placing low prior probability on parameter values that generate implausible moments in model simulations. The second type of prior is on a modelimplied object. The model has an ergodic mean conditional on the nonbinding regime that depends on the model solution. This mean is the level at which the economy stabilizes without any regime changes or shocks. The borrowing cushion associated with this mean implies a transition probability to the binding regime in equation (13). We set a prior on this model-object that is a Beta distribution with mean 0.01 and variance of 0.05.15 This prior places very low probability mass on combinations of parameters that imply too frequent transitions to the binding regime. Intuitively, it reflects the belief that, in the absence of shocks, the probability that the constraint becomes binding is very low. Table 1. Calibrated parameters. Parameter Description Value βDiscount Factor 0.99156 ρRisk Aversion 2 ωLabor Supply 1.846 ηCapital Share 0.3053 αLabor Share 0.5927 δDepreciation Rate 0.0228 A∗Mean Technology 1.7455 Z∗Mean Growth 1.006 P∗Mean Import Price 1.028 e∗Mean Expenditure 0.11 15Priors on model-implied objects are used and discussed, for example, in Otrok (2001) and Del Negro and Schorfheide (2008). 18 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) Table 2. Estimated parameters. Posterior Par. Description Prior Mode 5% 50% 95% ¯ rInt. Rate Mean N(0.0177, 0.005)0.006 0.005 0.006 0.007 ιCapital Adj. N(10, 5)5.769 5.169 5.769 5.967 φWorking Cap. U(0, 1)0.769 0.737 0.769 0.799 κ∗Leverage U(0, 1)0.182 0.171 0.182 0.195 logγ0Logistic, Enter Binding U(−20, 20)2.065 2.033 2.065 2.090 logγ1Logistic, Exit Binding U(−20, 20)4.925 4.900 4.925 4.961 ρaAutocor, TFP B(0.6, 0.2)0.982 0.961 0.982 0.988 ρzAutocor, TFP Growth B(0.6, 0.2)0.811 0.751 0.811 0.873 ρpAutocor, Imp Price B(0.6, 0.2)0.978 0.970 0.978 0.986 ρrAutocor, Int Rate B(0.6, 0.2)0.956 0.951 0.956 0.957 ρeAutocor, Expend B(0.6, 0.2)0.879 0.848 0.878 0.907 ρdAutocor, Pref B(0.6, 0.2)0.882 0.861 0.882 0.904 σa(L)Low SD, TFP IG(0.005, 0.01)0.005 0.004 0.005 0.005 σa(H)High SD, TFP IG(0.005, 0.01)0.012 0.011 0.012 0.012 σz(L)Low SD, TFP Growth IG(0.005, 0.01)0.003 0.001 0.003 0.003 σz(H)High SD, TFP Growth IG(0.005, 0.01)0.010 0.009 0.010 0.010 σp(L)Low SD, Imp Price IG(0.05, 0.01)0.027 0.025 0.027 0.029 σp(H)High SD, Imp Price IG(0.05, 0.01)0.063 0.061 0.063 0.065 σr(L)Low SD, Int Rate IG(0.01, 0.025)0.002 0.001 0.002 0.002 σr(H)High SD, Int Rate IG(0.01, 0.025)0.007 0.006 0.007 0.008 σe(L)Low SD, Exp IG(0.5, 0.5)0.160 0.117 0.160 0.194 σe(H)High SD, Exp IG(0.5, 0.5)0.384 0.322 0.384 0.438 σd(L)Low SD, Pref IG(0.05, 0.01)0.048 0.039 0.049 0.057 σd(H)High SD, Pref IG(0.05, 0.01)0.060 0.053 0.060 0.066 PσlProb, Stay Low Vol B(0.975, 0.025)0.958 0.937 0.958 0.976 PσhProb, Stay High Vol B(0.975, 0.025)0.949 0.941 0.949 0.955 Note: This table reports the prior distribution and the posterior moments of the estimated parameters. Priors are Normal (N), Uniform (U), Beta (B), or Inverse Gamma (IG) and show mean and variance, except for the uniform distribution showing the lower and upper bounds. Posterior distributions show mode, along with 5th, 50th, and 95th percentiles of the MCMC posterior draws. 4.3 Estimated parameters and model fit We now discuss the estimated parameters and the model’s fit to the data. Table 2reports the mode, the median, the 5th, and the 95th percentile of the posterior distribution. The parameters have tightly estimated posteriors, so we focus on the posterior modes. The estimated mean interest rate, with a mode of 0.6% per quarter, is higher than the calibrated value in Mendoza (2010). Since we use data on the interest rate as an observable, this parameter estimate is directly linked to that observable. The observed series exceeds our estimate of 0.6% for the early part of the sample, before gradually declining to a value closer to our estimate. The estimated model interprets the sample interest rate as a persistent process slowly converging to from a higher to a lower mean rate. The mode of the estimated investment adjustment cost parameter (ι) is 5.769. This parameter critically interacts with the financial friction parameters (working capital, leverage, and logistic function) to determine the dynamics of the model. Its estimated Quantitative Economics 16 (2025) Estimating models of financial crises 19 magnitude cannot be compared with the data outside the model. The estimated working capital constraint parameter (φ) is plausible, indicating that 77% of the wage and intermediate goods bill must be paid in advance with borrowed funds. This value is substantially higher than the 25.79% calibrated in Mendoza (2010) but lower than the 100% assumed by Neumeyer and Perri (2005) or the 125% used by Uribe and Yue (2006). The estimate is close to the 60% value estimated by Ates and Saffie (2016) using interest payments and production costs from Chilean microeconomic data. The estimated value of the leverage parameter in the borrowing constraint (κ) is 0.18, suggesting that less than a fifth of the value of capital serves as collateral. This value is slightly tighter than the baseline value of 0.20 calibrated in Mendoza (2010), and is at the low end of the 0.15– 0.30 range considered in that study. The posterior modes of the logistic parameters in equations (13)and(14) are 2.065 and 4.925 (in log points), respectively. They are estimated to be in a tight range relative to the very loose priors. Figure 2illustrates their implications for model dynamics. The figure plots the implied probabilities from equation (13)and(14), evaluated at the posterior mode value of γ0and γ1, together with the estimated ergodic distributions of their arguments, the borrowing cushion ˜ B∗and the constraint multiplier ˜ λ. Figure 2. The logistic functions and the distributions of their arguments. Note: The top panel shows the model-implied distribution of the borrowing cushion ˜ B∗in the nonbinding regime, and the logistic transition function to the binding regime implied by our estimates in of equation (13). The bottom panel shows the model-implied distribution of the multiplier λin the binding regime, and the transition function to the nonbinding regime as implied by our estimates in equation (14). 20 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) The top panel of Figure 2shows that the bulk of the probability mass is located on the positive side of the ergodic support for this variable, as the economy spends most of its time in the nonbinding regime, above the borrowing limit. As the borrowing cushion declines, the probability of switching to the binding regime increases very rapidly to 1 for small negative values of ˜ B∗, with a negligible probability mass on larger negative realizations. This implies a relatively quick transition into the binding regime once the borrowing cushion is exhausted as a result of shocks and agents’ decisions. The bottom panel of Figure 2shows that once the economy is in the binding regime, the ergodic distribution of the multiplier is centered on zero with approximately equal probability on both tails of the support. As ˜ λapproaches 0 from the positive side of the support, the probability of switching to the nonbinding regime increases only gradually, reaching 1 for λsmaller than −0.02.16 As we noted earlier, negative values of λreflect instances in which had the economy been in the nonbinding regime, the borrowing cushion would have been positive, but a switch to the nonbinding regime has not been drawn yet. The estimated values of the logistic function parameters imply that the economy suddenly enters a binding state but exits it only gradually, consistent with the evidence in Cerra and Saxena (2008)andBoissay, Collard, and Smets (2016), among others. Turning to the exogenous process estimates, all persistent parameters are estimated precisely, with their 95th percentile value below one, except for the temporary productivity shock, whose autocorrelation is very close to one. The estimated volatilities show that the highand low-volatility regimes are well identified. However, regime change is rare, perhaps reflecting the one-off change in the observable variable behavior after the 1994 Tequila crisis, which is distinctly visible in Figure 3. The observables used in the estimation are shown in Figure 3, together with the model-implied smoothed series based on the full sample period. The figure also highlights periods of currency or external debt crisis as identified in Reinhart and Rogoff (2009), shown in light gray areas. Since we have assumed a small variance of the measurement errors as a share of the observables’, the model tracks the data closely by construction. However, the tracking is consistent throughout the sample period, during both the regular business cycle and the highlighted crisis periods. For example, at the beginning of the 1980s debt crisis and during the 1994–1995 tequila crisis, the data show huge swings in the current account and large drops and rebounds in output, consumption, and investment growth without losing fit. If instead one were to observe a loss of fit during crisis episodes, it would suggest that the model finds it difficult to match the data dynamics during these episodes of critical interest in our empirical analysis.17 Likelihood-based estimation permits us to recover the historical shock series that drive the observable variables, which is not possible in a calibrated model. In other words, the estimation not only permits to assess which shocks drive the business cycle in the model, but also which shocks were historically more important in driving specific episodes of crises in Mexico’s history. 16Values of λapproximately below −0.2, produce a nearly deterministic switch back to the binding regime. The ergodic distribution of λin the binding regime (Figure 2b) implies that the probability of exiting that regime exceeds 99% about a quarter of the time. 17See the SA for more details. Quantitative Economics 16 (2025) Estimating models of financial crises 21 Figure 3. Data and model estimates. Note: The figure plots observable variables used in estimation (solid black lines) and fitted values (i.e., model-implied smoothed estimated series based on the full sample, dashed red lines). Light gray areas indicate periods of currency or external debt crisis as identified in Reinhart and Rogoff (2009). Figure 4plots the shocks implied by the estimated model in standard deviation units together with a two-standard deviation band. Because the model tracks the observed series closely and evenly over time, the recovered structural shocks are informative about 22 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) Figure 4. Model estimated shocks. Notes: The figure plots the estimated model implied shocks, in standard deviation units, together with a two-standard deviation band (black dashed lines). Light gray areas indicate periods of currency or external debt crisis as identified in Reinhart and Rogoff (2009). Quantitative Economics 16 (2025) Estimating models of financial crises 23 the model mechanisms’ ability to drive the outsize movements in the data during crisis periods. If only normally sized shocks are needed, then the model’s internal propagation mechanisms must account for the abnormal fluctuations in the data; alternatively, reliance on large, low-probability shocks would cast doubt on the model’s ability to capture the crisis dynamics. Well-behaved realized shocks also provide evidence that supports our choice of using the Sigma Point filter. As we can see from Figure 4, the estimated model fits the data without systematically relying on large shocks, although there are two instances in which large shocks are needed. First, at the beginning of the sample period in 1982:Q3 and Q4, at the peak of the debt crisis, when Mexico devalued the Peso, declared default on its external debt, and nationalized the banking system, very large expenditure and especially preference shocks help to match the current account, which reverted by about 12 percentage points of GDP by the end of that year. Second, an outsize interest rate shock is needed in 1995:Q1, when output dropped by more than 5% in a quarter (the largest change in the sample period), at the end of the Federal Reserve’s tightening cycle that started in 1994:Q1, and after the peg was abandoned in December 1994. Two large temporary productivity shocks also match two high growth quarters after the tequila crisis. All other shock realizations are within the two-standard deviation band.18 4.4 Model comparisons As a further step in validating our model, Table 3reports the results of a model comparison exercise using the Schwarz Information Criterion (SIC). We compare our model with a specification with exogenous regime switching and another one without the borrowing constraint. For each of these three models, we also consider a version without stochastic volatility. The SA provides more detail on their estimation and reports modelspecific parameter estimates. The statistic reported is the model’s posterior density at the posterior mode, adjusted by the Schwarz Information Criteria (SIC) to penalize for additional parameters.19 A difference of 10 indicates “strong” evidence in favor of the Table 3. Model comparison—Schwarz information criteria. Model With Stoch Vol No Stoch Vol Endogenous Switching −4074 −3663 Exogenous Switching −4039 −3651 No Constraint −3842 −3465 18Three more import price shocks are outside the two-standard deviation error bands: in 2008:Q3, when the oil price reached its historical record high level of $150 per barrel; in 1986:Q1 during the Iran–Iraq War before the oil price collapse later in 1986, and in 1990:Q4 and 1991:Q1 due to the 1991 Iraq War. However, import price shocks are directly implied from the observable series based on commodity terms of trade data. 19See Liu, Waggoner, and Zha (2011) for a discussion of the SIC as a goodness-of-fit measure and the challenges of computing marginal data densities in the context of regime switching models, even without considering endogenous switching as in our model. 24 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) model with the lower SIC, and a difference of 100 indicates ‘decisive’ evidence (Kass and Raftery (1995)). The SIC results in Table 3have three important implications about the fit of our model. First, for all three model specifications, the data prefer the version with stochastic volatility. This result underscores the importance of considering changes in volatility as a driving force in emerging markets, as stressed in Fernandez-Villaverde et al. (2011). Second, the data prefer switching models with a collateral constraint relative to a version without the collateral constraint, where financial frictions take the form of a debt-elastic component on the interest rate. Finally, the data prefer the model version with endogenous switching that we propose to a traditional one in which regime switches are exogenous events with constant transition probabilities. In other words, the model that fits the data best is one in which there is stochastic volatility, regimes based on the state of the collateral constraint (and hence a collateral constraint), and switching between the states of this constraint that is endogenously driven by leverage rather than exogenous probabilities. 5. The anatomy of Mexico’s business cycles and financial crises In this section, we study Mexico’s history of business cycles and sudden-stop crises through the lens of our estimated model. We first compare moments simulated by the model and in the data and assess the relative importance of different shocks in the business cycle by means of a variance decomposition. We then focus on the model’s fit and the drivers of Mexico’s history of sodden stop crises. 5.1 Business cycles Table 4compares the data and the simulated second moments of the model, reporting results for output growth, consumption growth, investment growth, the interest rate, trade balance, and the current account.20 Table 4. Simulated second moments: data and model. Std. Dev. Relative Std. Dev. Correlations Data Series Data Model Data Model Data Model GDP Growth 1.41 3.34 1 1 1 1 Cons Growth 1.76 6.44 1.25 1.93 0.73 0.75 Inv Growth 7.57 54.69 5.37 16.38 0.53 0.35 Interest Rate 1.92 1.35 1.36 0.41 −0.11 −0.04 TB/GDP 2.9 9.5 2.0 2.8 0.14 −0.31 CA/GDP 2.2 9.2 1.56 2.76 −0.1 −0.3 Note: The table compares the second moments of the data relative to the moments simulated from the model. 20 All model-based statistics are based on simulated data from the posterior mode estimates. We generate 100,000 samples of 144 quarters length (the same as our data sample), after a burn-in period of 1000 quarters. We then compute the median values for these 100,000 runs. We use the pruning method in Andreasen, Fernandez-Villaverde, and Rubio-Ramirez (2018) to avoid explosive simulation paths. All reported simulated moments are unconditional rather than conditional on a particular regime. Quantitative Economics 16 (2025) Estimating models of financial crises 31 subject to Ct+It+Et=AtKη t−1(ZtHt)αV1−α−η t−PtVt−φrt(WtHt+PtVt) −1 (1+rt)Bt+Bt−1. (A.2) The preference shock follows logdt=ρdlogdt−1+σdεd,t. (A.3) Transitory technology follows logAt=(1−ρa)log ¯ A+ρalogAt−1+σaεa,t, (A.4) while permanent technology follows logZt=(1−ρz)log ¯ Z+ρzlogZt−1+σzεz,t. (A.5) Total value added or GDP is given by Yt=AtKη t−1(ZtHt)αV1−α−η t−PtVt. (A.6) Capital accumulates according to Kt=(1−δ)Kt−1+It−ι 2Kt−kKt−1 Kt−12 Kt−1, (A.7) where Itdenotes investment and kthe growth rate of capital along the balanced growth path. The expenditure process Etfollows loget=(1−ρe)log ¯ e+ρeloget−1+σeεe,t, (A.8) where et=Et/Zt−1. (A.9) In the binding regime, the collateral constraint is given by 1 (1+rt)Bt−φ(1+rt)(WtHt+PtVt)=−κqtKt, (A.10) with the corresponding multiplier denoted λt. In the nonbinding regime, the collateral constraint disappears, and the multiplier is λt=0. The constraint is implemented by defining B∗ t=1 (1+rt)Bt−φ(1+rt)(WtHt+PtVt)+κqtKt(A.11) and using the regime-switching slackness condition ϕ(st)B∗ ss +ν(st)B∗ t−B∗ ss=1−ϕ(st)λss +1−ν(st)(λt−λss )(A.12) 32 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) The household-firm maximizes the following Lagrangian: L=E0 ∞  t=0 dtβtCt−Zt−1 Hω t ω1−ρ −1 1−ρ + ∞  t=0 βtμt ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ AtKη t−1(ZtHt)αV1−α−η t−PtVt−φrt(WtHt+PtVt) −1 (1+rt)Bt+Bt−1 −Ct−Kt+(1−δ)Kt−1−ι 2Kt−kKt−1 Kt−12 Kt−1−Et ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ + ∞  t=0 βtλt1 (1+rt)Bt−φ(1+rt)(WtHt+PtVt)+κqtKt. The first-order conditions are Ct:dtCt−Zt−1 Hω t ω−ρ −μt=0; (A.13) Pt:μt(1−α−η)AtKη t−1(ZtHt)αV−α−η t−Pt−φrtPt−λtφ(1+rt)Pt=0; (A.14) Ht:⎡ ⎢ ⎣ −dtCt−Zt−1 Hω t ω−ρ Zt−1Hω−1 t +μtαAtKη t−1Zα tHα−1 tV1−α−η t−φrtWt−λtφ(1+rt)Wt ⎤ ⎥ ⎦=0; (A.15) Bt:−μt 1+rt +βμt+1+λt 1+rt =0; (A.16) Kt:⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ μt−1−ιKt−kKt−1 Kt−1+λtκqt +βμt+1⎛ ⎜ ⎝ ηAt+1Kη−1 t(Zt+1Ht+1)αV1−α−η t+1+1−δ +ιkKt+1−kKt Kt+ι 2Kt+1−kKt Kt2⎞ ⎟ ⎠ ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ =0. (A.17) Combining and simplifying these expressions produces dtCt−Zt−1 Hω t ω−ρ =μt; (A.18) (1−α−η)AtKη t−1(ZtHt)αV−α−η t=Pt1+φrt+λt μt φ(1+rt); (A.19) αAtKη t−1Zα tHα−1 tV1−α−η t=φWtrt+λt μt (1+rt) +Zt−1Hω−1 t; (A.20) μt=λt+β(1+rt)Etμt+1; (A.21) Quantitative Economics 16 (2025) Estimating models of financial crises 33 βEtμt+1 ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ ηAt+1Kη−1 t(Zt+1Ht+1)αV1−α−η t+1 +1−δ +ιkKt+1−kKt Kt +ι 2Kt+1−kKt Kt2 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ =μt1+ιKt−kKt−1 Kt−1 −λtκqt. (A.22) Factor prices must satisfy Wt=−∂U/∂Ht ∂U/∂Ctand qt=∂It/∂Kt, which means Wt=Zt−1Hω−1 t, (A.23) qt=1+ιKt−kKt−1 Kt−1. (A.24) The interest rate is an exogenous process given by r∗ t=(1−ρr)¯ r∗+ρrr∗ t−1+σrεr,t, (A.25) with the possibility of a debt-premium (only in an alternative model specification, in the baseline ψ=0) specified as follows: rt=r∗ t+ψexp(¯ b−Bt/Zt−1)−1. (A.26) The external financing premium on debt is EFPDt=λt βEtμt+1 . (A.27) A.2 Competitive equilibrium A competitive equilibrium of our economy is a sequence of quantities {Kt,Bt,Ct,Ht,Vt, It,At,Zt,dt,Et,B∗ t}and prices {Pt,r∗ t,rt,qt,wt,μt,λt}that, given the 5 exogenous processes (A.3), (A.4), (A.5), (A.8), (A.25), satisfies the first-order conditions for the representative household-firm (A.18)–(A.22), the market price equations (A.23)–(A.24), the market clearing conditions (A.2)–(A.7), the debt cushion definition (A.11), regime-switching slackness condition (A.12), and the equation for the interest rate (A.26). Appendix B: Perturbation solution method This Appendix provides details about two aspects of the solution method: (1) the definition of, and solution for, the steady state of the endogenous regime-switching economy; and (2) the perturbation method that generates second-order Taylor expansions to the solution of the economy around the steady state. For notational simplicity, we focus on a version of the model without volatility switching. 34 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) B.1 Regime switching equilibrium Write the equilibrium conditions as Etf(yt+1,yt,xt,xt−1,χεt+1,εt,θt+1,θt)=0. (B.1) Here, ytdenotes the non-predetermined variables, xtpredetermined variables, εtthe exogenous shocks, θtthe regime-switching parameters, and χthe perturbation parameter. In general, the regime-switching parameters are partitioned into those that affect the steady state, θ1,t,andthosethatdonot,θ2,t.23 In the case of our specific application, the partition is θ1,t=!ϕ(st)"θ2,t=!ν(st)".(B.2) In order to solve the model, we assume the functional forms θ1,t+1= ¯ θ1+χˆ θ1(st+1),θ1,t= ¯ θ1+χˆ θ1(st),(B.3) θ2,t+1=θ2(st+1),θ2,t=θ2(st),(B.4) xt=hst(xt−1,εt,χ),(B.5) yt=gst(xt−1,εt,χ),yt+1=gst+1(xt,χεt+1,χ)(B.6) and Pst,st+1,t=πst,st+1(yt).(B.7) Now, substituting these functional forms in the equilibrium conditions and being more explicit about the expectation operator, given (xt−1,εt,χ)and st,wehave Fst(xt−1,εt,χ)=#1  s=0 πst,sgst(xt−1,εt,χ) ×f⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ gst+1hst(xt−1,εt,χ),χε,χ, gst(xt−1,εt,χ), hst(xt−1,εt,χ), xt−1,χε,εt, ¯ θ+χˆ θs, ¯ θ+χˆ θ(st) ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ dμε,(B.8) where dμεdenotes the joint pdf of the shocks. Finally, stacking all conditions by regime yields F(xt−1,εt,χ)=Fst=0(xt−1,εt,χ) Fst=1(xt−1,εt,χ)=0. (B.9) 23In the version with volatility switches, these parameters belong to the second set. Quantitative Economics 16 (2025) Estimating models of financial crises 35 B.2 Steady-state definition and solution The model has two features that make defining a steady state challenging. First, as it is common in a regime-switching framework, some structural parameters may be switching. In the case of our application, there is only one switching parameter that affects the steady state, ϕ(st). Nonetheless, in principle, one could allow for regime switching also in the parameters of the exogenous processes, A∗(st)and P∗(st), or the structural parameter κ∗(st), which would affect the level of the economy and the steady-state calculations. Following Foerster et al. (2016), we define the steady state in terms of the ergodic means of these parameters across regimes. To define the steady state, we set εt=0and χ=0, which implies that the steady state is given by fyss,yss,xss,xss,0,0, ¯ θ1,θ2s, ¯ θ1,θ2(s)=0 (B.10) for all s,s. In our case, the transition matrix evaluated at steady-state Pss is endogenous, since it depends on variables that in turn depend on the steady-state value of the transition matrix. To find a solution for the steady state (balanced growth path), we proceed in two steps. First, we assume the steady-state transition matrix is known and solve for all the steadystate prices and quantities. Second, we use the steady-state values of the borrowing cushion ˜ B∗ ss and multiplier λss from step 1 to update the steady-state transition matrix. We then iterate to convergence. Step 1: Solve steady state using a given steady-state transition matrix. First, assume that the steady-state transition matrix at iteration i,P(i) ss , is known. Next, let ξ= [ξ0,ξ1]denote the ergodic vector of P(i) ss . Then, as noted in the paper, define the ergodic means of the switching parameters as ¯ϕ=ξ0ϕ(0)+ξ1ϕ(1). The steady state of the regime-switching economy depends on these ergodic means, and we can now solve for the steady states of all variables. Step 2: Updating the transition matrix. Step 1 yields the variables ˜ B∗ ss and λss,and hence, provides a new value of the transition matrix for iteration i+1: P(i+1) ss =p00,ss p01,ss p10,ss p11,ss=⎡ ⎢ ⎢ ⎢ ⎣ 1−exp−γ0˜ B∗ ss 1+exp−γ0˜ B∗ ss exp−γ0˜ B∗ ss 1+exp−γ0˜ B∗ ss exp(−γ1λss ) 1+exp(−γ1λss )1−exp(−γ1λss ) 1+exp(−γ1λss) ⎤ ⎥ ⎥ ⎥ ⎦ , (B.11) which can be checked against the guess in Step 1. We then iterate to convergence until $ $P(i+1) ss −P(i) ss $ $<tolerance, where in our application we use a tolerance of 10−10. 36 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) B.3 Generating approximations To compute a second-order approximation to the endogenous regime-switching model solution, we largely follow Foerster et al. (2016), adapting to the case with endogenous probabilities. We take the stacked equilibrium conditions F(xt−1,εt,χ), and differentiate with respect to (xt−1,εt,χ). The first-order derivative with respect to xt−1produces a polynomial system denoted Fx(xss,0,0 )=0. (B.12) In Foerster et al. (2016), when the transition probabilities are exogenous and fixed, this system needs to be solved via Gröbner bases, which finds all possible solutions in order to check them for stability. The relevant stability concept is mean square stability (MSS), which requires the expectation of first and second moments to be finite (see Costa, Fragoso, and Marques (2005)). In our case with endogenous probabilities, the check for MSS is not applicable, so we focus on finding a single solution and ignore the possibility of multiple solutions or indeterminacy, a common simplification in the regime-switching literature with and without endogenous switching (e.g., Farmer, Waggoner, and Zha (2011), Foerster (2015), Maih (2015), Lind (2014)). This simplification is also common to global solution methods of models with occasionally binding constraints, where numerical methods converge to a given solution but do not guarantee uniqueness of that solution. Instead, the focus typically is on checking robustness of the solution to initial conditions. While in some simpler models with collateral constraints it is possible to impose parametric restrictions that rule out multiple equilibria (SchmittGrohe and Uribe (2020), Benigno et al. (2016)), in the case of our model, as in Mendoza (2010)andBianchi and Mendoza (2018), there are no such restrictions and uniqueness must be verified numerically. To find a model solution, we guess a set of policy functions for regime st=1, which reduces the equilibrium conditions Fx(xss,0,0;st=0)to a fixed-regime eigenvalue problem, and solve for the policy functions for st=0. Then, using this initial solution as a guess, we solve for regime st=0 under the fixed-regime eigenvalue problem, and iterate to convergence. After solving the iterative eigenvalue problem, the remaining systems to solve are Fε(xss,0,0 )=0, (B.13) Fχ(xss,0,0 )=0, (B.14) and the second-order systems of the form Fi,j(xss,0,0 )=0, i,j∈{x,ε,χ}. (B.15) Recalling now that the decision rules have the form xt=hst(xt−1,εt,χ), (B.16) yt=gst(xt−1,εt,χ), (B.17) Quantitative Economics 16 (2025) Estimating models of financial crises 37 the second-order approximation are xt≈xss +H(1) stSt+1 2H(2) st(St⊗St), (B.18) yt≈yss +G(1) stSt+1 2G(2) st(St⊗St)(B.19) where St=[(xt−1−xss )ε t1],withxss denoting the value of the steady-state variables. B.4 Proof of Proposition 1(properties of the approximated solution) To prove Proposition 1, take the first-order derivatives of (B.9) with respect to its arguments, evaluated at the steady state. This yields Fx,st(xss,0,0 )= s πst,s,y(yss )gx,stfsss,st + s πst,s(yss )fyt+1s,stgx,shx,st+fyts,stgx,st +fxts,sthx,st+fxt−1s,st, (B.20) Fε,st(xss,0,0 )= s πst,s,y(yss )gε,stfsss,st + s πst,s(yss )fyt+1s,stgx,shε,st+fyts,stgε,st +fxts,sthε,st+fεts,st(B.21) and Fχ,st(xss,0,0 )= s πst,s,y(yss )gχ,stfsss,st + s πst,s(yss )⎡ ⎢ ⎣ fyt+1s,stgx,shχ,st+fyts,stgχ,st +fxts,sthχ,st +fθt+1s,stˆ θ(st+1)+fθts,stˆ θ(st) ⎤ ⎥ ⎦. (B.22) Note now that, by definition of a steady state, fss(s,st)=0, and so the first term of each of these expressions equals zero. Hence, we are left with the expressions for the exogenous transition probabilities as in Foerster et al. (2016), given by Pss =πst,s(yss ). To prove the second part of the proposition, namely that endogenous regimeswitching shows up at second order, it suffices to show that the second derivatives of the system with respect to xt−1are dependent on the derivatives of the probability functions. We include the full set of the second-order derivatives in the SA. Now note that the derivatives have the following form: [Fs,xx]a b,c=A+ s j πs,s,yj,tgj s,xbB+ s j πs,s,yj,tgj s,xcC, (B.23) where A,B,Care expressions include scalars and unknowns. It is now evident that this equation is a function of πs,s,yj,t, meaning that second-order coefficients of the decision-rules are functions of the change in the probabilities. QED. 38 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) Appendix C: Solution accuracy and comparison with traditional inequality specification To gauge the accuracy and speed of our solution method and to compare the endogenous regime switching specification of the borrowing constraint relative to the traditional inequality one, we compare a suitably modified and calibrated version of our model to Mendoza (2010)solvedwiththeFiPItmethodofMendoza and Villalvazo (2020).24 To do so, we calibrate our model at an annual frequency and retain the interest rate, productivity, and intermediate input price shocks, as in Mendoza and Villalvazo (2020), and drop the expenditure and preference shocks and the permanent productivity shock. We then compare Euler equation errors and solution speed, simulated model first and second moments, ergodic distributions, and decision rules for bond holding and capital. In the endogenous regime switching model, we calibrate all common model parameters as in Mendoza and Villalvazo (2020). The logistic function parameters are specific to our model. We set γ0=γ1=30 to match the probability of a positive multiplier on the borrowing constraint. Both Mendoza (2010)andMendoza and Villalvazo (2020)use finite-state Markov processes, while we use discrete-time autoregressive processes over a continuous support. We set these parameters so that the unconditional moments of the two sets of processes coincide. Table C.1 reports the statistics on the errors in the Euler equation and the computation time. The table illustrates a stark trade-off between speed and accuracy. Our method is about 800 times faster than the FiPIt, with log-10 absolute Euler equation errors that are 1–3 times larger than FiPIt. The size of our Euler equation errors is in line with the values typically found when solving exogenous regime-switching models with perturbation methods (Foerster et al. (2016)) and models without regime switching (Aruoba, Fernandez-Villaverde, and Rubio-Ramirez (2006)). To put these numbers in perspective, the implied accuracy differences represent only a dollar error per 1000 dollars of consumption, which is very small in absolute terms by the standards in the literature. Table C.2 compares the first and second moments and the probability of a positive multiplier. To size the differences between FiPIt and our model, as a reference, we also Table C.1. Solution accuracy and speed. FiPIt Mendoza (2010)End.Switch. Euler Equation Errors (log10 units) Bond – Mean −6.27 na −2.92 Bond – Max −1.56 na −1.61 Capital – Mean −7.04 na −3.61 Capital – Max −6.68 na −2.41 Computing Time (seconds) 810 na 1.00 24See Binning and Maih (2017) for an analysis of the properties of our solution method applied to other structural models, such as the zero lower bound, in which they found a high degree of accuracy. Quantitative Economics 16 (2025) Estimating models of financial crises 39 Table C.2. First and second moments. FiPIt Mendoza (2010)End.Switch. Means gdp 393.619 388.339 393.168 c 274.123 267.857 268.826 inv 67.481 65.802 67.136 nx/gdp (%) 1.5 2.4 −0.3 k 765.171 747.709 763.154 b/gdp (%) 1.3 −10.4 −17.9 q111 lev (%) −10.3 −15.9 −19.4 v 42.617 41.949 42.600 wc 76.658 75.455 76.598 Standard deviations (%) gdp 3.94 3.85 3.81 c 4.03 3.69 3.628 inv 13.33 13.45 10.884 nx/gdp 2.94 2.58 1.307 k 4.49 4.31 4.185 b/gdp 19.62 8.9 2.154 q 3.2 3.23 2.568 lev 9.22 4.07 8.560 v 5.89 5.84 5.87 wc 4.35 4.26 4.21 Correlations with with gdp gdp 1 1 1 c 0.842 0.931 0.984 inv 0.641 0.641 0.748 nx/gdp −0.117 −0.184 −0.047 k 0.761 0.744 0.849 b/gdp −0.12 −0.298 −0.172 q 0.387 0.406 0.478 lev −0.111 0.258 −0.076 v 0.832 0.823 0.832 wc 0.994 0.987 0.994 Autocorrelations gdp 0.825 0.815 0.815 c 0.83 0.766 0.804 inv 0.501 0.483 0.441 nx/gdp 0.601 0.447 0.246 k 0.962 0.963 0.975 b/gdp 0.99 0.087 0.779 q 0.447 0.428 0.350 lev 0.992 0.04 0.864 v 0.777 0.764 0.774 wc 0.801 0.777 0.784 Sudden-stop statistics (%) Prob. positive multiplier 2.6 na 3.615 40 Benigno, Foerster, Otrok, and Rebucci Quantitative Economics 16 (2025) report the simulated second moments from the original Mendoza (2010). The comparison shows that our specification of the occasionally binding borrowing constraint essentially produces the same first and second moments as the FiPIt, with differences that are very small relative to the gaps between the FiPIt and Mendoza (2010). Two exceptions are the net foreign asset position as a share of GDP (b/GDP) and the net export-to-GDP ratio (nx/GDP). The ergodic mean of b/GDP is about −17.9% in our model, while it is small and positive in the FiPIt model (1.3%).25 In Mendoza (2010), this simulated moment is about −10%. Mexico’s net foreign asset position averaged −37% of GDP and was never positive from 1970 to 2015. Therefore, our model generates an ergodic mean of debt significantly closer to the average in the data compared to the FiPIt. The second discrepancy is nx/GDP, which is negative −0.3% in our model, while it is positive 1.5% in the FiPIt, and 2.4% in Mendoza (2010). The FiPIt generates a counterfactual net foreign asset position with a positive net export-to-GDP ratio that should be negative in the ergodic distribution if the bond position is positive. Our model generates a data-consistent debt position with a small negative ergodic trade surplus. In contrast, in Mendoza (2010), the ergodic trade balance and debt proportions have the opposite sign as one would expect. Our model also generates a less volatile bond position and trade balance relative to FiIPt, which in turn generates more volatility than the original Mendoza (2010). A result that could be due to the mechanics of our specification of the borrowing constraint. Figure C.1 plots the ergodic distributions of debt (panel a) and capital (panel b), together with their joint distribution as in Figure 1 of Mendoza and Villalvazo (2020). The debt distribution of our model has little or no density outside the [−100, 0] interval of the support. In contrast, the FiPIt distribution has a significant probability mass on positive and large values, which is counterfactual as we discussed above. Instead, the ergodic distribution of capital has essentially the same support in the two models. The joint distribution reflects these differences. The policy functions of our model solved with perturbation methods illustrate its ability to capture the occasionally binding nature of the borrowing constraint consistent with Proposition 1. Figure C.2 plots the decision rules for capital, bonds, and the borrowing cushion in our model, in both the nonbinding and the binding regimes. These rules are evaluated at the steady-state values of the technology, interest rate, and intermediate input price processes, covering a rectangular support associated with the joint ergodic distribution of capital and debt. Therefore, the decision rules presented here are conditional on no shocks. Importantly, note here that the actual behavior of the model also depends on the specific values of the exogenous states. In our framework, endogenous states, exogenous processes, and shocks all have continuous support; while FiPIt’s use of a discretized state space means that a finite set of states are repeatedly visited. This fact is crucial because the ergodic sets are influenced by the underlying processes. In other words, the portions of the distribution’s support that the economy visits depend 25All model and solution variants reported in Mendoza and Villalvazo (2020) also have a positive level of ergodic debt. Quantitative Economics 16 (2025) Estimating models of financial crises 47 Miyamoto, Wataru and Thuy Lan Nguyen (2017), “Business cycles in small open economies: Evidence from panel data between 1900 and 2013.” International Economic Review, 58 (3), 1007–1044. [0025] Neumeyer, Pablo A. and Fabrizio Perri (2005), “Business cycles in emerging economies: The role of interest rates.” Journal of Monetary Economics, 52 (2), 345–380. [0019] Otrok, Christopher (2001), “On measuring the welfare cost of business cycles.” Journal of Monetary Economics, 47 (1), 61–92. [0004,0017] Reinhart, Carmen M. and Kenneth S. Rogoff (2009), This Time Is Different: Eight Centuries of Financial Folly. Princeton University Press. [0003,0004,0011,0020,0021,0022, 0026,0027,0029] Schmitt-Grohe, Stephanie and Martin Uribe (2020), “Multiple equilibria in open economies with collateral constraints.” Review of Economic Studies, 59 (1), 85–111. [0011,0014,0036] Schorfheide, Frank (2000), “Loss function-based evaluation of DSGE models.” Journal of Applied Econometrics, 15 (6), 645–670. [0004] Smets, Frank and Raf Wouters (2007), “Shocks and frictions in US business cycles: A Bayesian DSGE approach.” American Economic Review, 97 (3), 586–606. [0004,0016] Uribe, Martin and Vivian Z. Yue (2006), “Country spreads and emerging countries: Who drives whom?” Journal of International Economics, 69 (1), 6–36. [0016,0019] Co-editor Morten O. Ravn handled this manuscript. Manuscript received 22 November, 2021; final version accepted 8 November, 2024; available online 14 November, 2024. The replication package for this paper is available at https://doi.org/10.5281/zenodo.14026657. The Journal checked the data and codes included in the package for their ability to reproduce the results in the paper and approved online appendices.