DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DEPARTAMENTO DE ECONOMÍA Pontificia Universidad Católica del Perú DT DECON DOCUMENTO DE TRABAJO TIME CHANGING EFFECTS OF EXTERNAL SHOCKS ON MACROECONOMIC FLUCTUATIONS IN PERU: EMPIRICAL APPLICATION USING REGIME-SWITCHING VAR MODELS WITH STOCHASTIC VOLATILITY Nº 509 Paulo Chávez y Gabriel Rodríguez DOCUMENTO DE TRABAJO N° 509 Time Changing Effects of External Shocks on Macroeconomic Fluctuations in Peru: Empirical Application Using Regime-Switching VAR Models with Stochastic Volatility Paulo Chávez y Gabriel Rodríguez Marzo, 2022 DOCUMENTO DE TRABAJO 509 http://doi.org/10.18800/2079-8474.0509 http://doi.org/10.18800/2079-8474.0509 Time Changing Effects of External Shocks on Macroeconomic Fluctuations in Peru: Empirical Application Using Regime-Switching VAR Models with Stochastic Volatility Documento de Trabajo 509 © Paulo Chávez y Gabriel Rodríguez Editado e Impreso: © Departamento de Economía – Pontificia Universidad Católica del Perú Av. Universitaria 1801, Lima 32 – Perú. Teléfono: (51-1) 626-2000 anexos 4950 - 4951 econo@pucp.edu.pe http://departamento.pucp.edu.pe/economia/publicaciones/documentos-de-trabajo/ Encargada de la Serie: Roxana Barrantes Cáceres Departamento de Economía – Pontificia Universidad Católica del Perú Barrantes.r@pucp.edu.pe Primera edición – Marzo, 2022 ISSN 2079-8474 (En línea) mailto:econo@pucp.edu.pe mailto:Barrantes.r@pucp.edu.pe Time Changing Effects of External Shocks on Macroeconomic Fluctuations in Peru: Empirical Application Using Regime-Switching VAR Models with Stochastic Volatility∗ Paulo Chávez† Pontificia Universidad Católica del Perú Gabriel Rodríguez ‡ Pontificia Universidad Católica del Perú March 15, 2022 Abstract This article quantifies and analyzes the evolving impact of external shocks on Peru’s macroeco- nomic fluctuations in 1994Q1-2019Q4. For this purpose, we use a group of models with regime- switching time-varying parameters and stochastic volatility (RS-VAR-SV), as proposed by Chan and Eisenstat (2018). The data suggest a model with contemporaneous coefficients and con- stant lags and intercepts, but with regime-switching variances; and point to the existence of two regimes. The IRFs, FEVDs, and HDs show that: (i) China growth shocks have a higher impact on Peru’s output growth (around 0.8%); (ii) financial shocks contract domestic output growth by 0.3% and domestic monetary policy is synchronized with Fed rate movements; (iii) external shocks explain 35% and 70% of output fluctuations under regimes 1 and 2, respectively; and (iv) China growth shocks contributed 1.0 p.p. to the 1.1-p.p. increase (around 89%) in Peru’s output growth between regimes 1 and 2. Additionally, we validate these results by performing seven robustness exercises consisting in changing priors, reordering variables, changing variables, and using four different specications for the baseline model. JEL Classification: C11, C32, C52, E32, F41. Keywords: External Shocks, Macroeconomic Fluctuations, Regime-Switching Autoregressive Vec- tors, Stochastic Volatility, Model Comparison, Peruvian Economy. ∗This paper is drawn from the Master’s Thesis of Paulo Chávez at the Graduate School of the Pontificia Universidad Católica del Perú (PUCP). We thank the useful comments of Paul Castillo (Central Reserve Bank of Peru and PUCP) and Oscar Dancourt (PUCP). Any remaining errors are our responsibility. †Department of Economics, Pontificia Universidad Católica del Perú, Av. Universitaria 1801, Lima 32, Lima, Peru, E-Mail Address: paulo.chavez@pucp.edu.pe. ‡Address for Correspondence: Gabriel Rodríguez, Department of Economics, Pontificia Universidad Católica del Perú, 1801 Universitaria Avenue, Lima 32, Lima, Perú, Telephone: +511-626-2000 (4998). E-Mail Address: gabriel.rodriguez@pucp.edu.pe, ORCID ID: https://orcid.org/0000-0003-1174-9642. Efectos Cambiantes en el Tiempo de Choques Externos sobre Fluctuaciones Macroeconómicas en Perú: Aplicación Empírica usando Modelos VAR con Cambio de Regimen y Volatilidad Estocástica∗ Paulo Chávez† Pontificia Universidad Católica del Perú Gabriel Rodríguez‡ Pontificia Universidad Católica del Perú 15 de Marzo 2022 Resumen Este artículo cuantifica y analiza la evolución del impacto de los choques externos en las fluctuaciones macroe- conómicas del Perú en 1994Q1-2019Q4. Para este propósito, usamos un grupo de modelos de vectores autore- gresivos con parámetros con cambio de regimen y volatilidad estocástica (RS-VAR-SV), según lo propuesto por Chan y Eisenstat (2018). Los datos sugieren la preferencia por un modelo con coeficientes contemporáneos y rezagos e intercepciones constantes, pero con varianzas dependientes del regimen; y se observa la existencia de dos regímenes. Las IRFs, FEVDs y HDs muestran que: (i) los choques de crecimiento de China tienen un mayor impacto en el crecimiento de la producción de Perú (alrededor del 0.8%); (ii) los choques financierios contraen el crecimiento de la producción interna en un 0.3% y la política monetaria doméstica se sincroniza con movimientos de la tasa de la Reserva Federal; (iii) los choques externos explican el 35% y el 70% de las fluctuaciones del producto en los regímenes 1 y 2, respectivamente; y (iv) los choques de crecimiento de China contribuyen con 1.0 p.p. de 1.1-p.p. (alrededor del 89%) del crecimiento de la producción de Perú entre los regímenes 1 y 2. Los resultados son validados utilizando siete ejercicios de robustez que consisten en cambiar las priors, reordenar las variables, cambiar las variables y usar cuatro especificaciones diferentes para el modelo de base. Clasificación JEL: C11, C32, F41, F44, F62. Palabras Claves: Choques Externos, Fluctuaciones Macroeconómicas, Vectores Autoregresivos con Cambio de Regimen, Volatilidad Estocástica, Estimación y Comparación Bayesiana, Economía Peruana. ∗Este documento está basado en la Tesis de Maestría en Economía de Paulo Chávez, Escuela de PosGrado de la Pontificia Universidad Católica del Perú (PUCP). Los autores agradecen los comentarios de Paul Castillo (Banco Central de Reserva del Perú y PUCP) y Oscar Dancourt (PUCP). Cualquier error remanente es nuestra responsabilidad. †Departamento de Economía, Pontificia Universidad Católica del Perú, Av. Universitaria 1801, Lima 32, Lima, Perú. Correo Electrónico: paulo.chavez@pucp.edu.pe. ‡Dirección de Correspondencia: Gabriel Rodríguez, Departamento de Economía, Pontificia Universidad Católica del Perú, Av. Universitaria 1801, Lima 32, Lima, Perú, Teléfono: +511-626-2000 (4998). Correo Electrónico: gabriel.rodriguez@pucp.edu.pe, ORCID ID: https://orcid.org/0000-0003-1174-9642. 1 Introduction External shocks on Latin American developing economies, like Peru, are considered the main source of variability in output �uctuations, according to Izquierdo et al. (2008). Greater trade and �nancial integration in recent years has magni�ed this e¤ect in countries that depend heavily on commodity exports. Since the 1990s, several �nancial crises, the commodity supercycle, and China�s high growth (and subsequent deceleration) have been the object of intense study and a source of concern in academia; see Cesa-Bianchi et al. (2013), Gruss (2014), and Bing et al. (2019). In this context, a crucial issue is the severity of external shock e¤ects on macroeconomic variables in boom-bust cycles; see Calvo et al. (1993). This evolving international environment has led policymakers to revise their responses over time via new instruments or even institutional changes related to the role of monetary and �scal authorities. Peru�s case is relevant, given its role as a major supplier of metal commodities to industrialized economies like China and the U.S. Moreover, with sound macroeconomic indicators resulting from �scal and monetary discipline (IMF (2020)), Peru has become an attractive destination for inter- national investors. At the same time, in this context, �uctuations in domestic aggregate variables are exposed to shocks from various sources: (i) real or external demand shocks, mainly from the U.S. and China, Peru�s main trading partners; (ii) the �nancial channel; i.e., movements in the international interest rate a¤ecting investment returns and �nancial costs; and (iii) nominal or commodity price shocks; i.e., movements in the prices of Peru�s exports and imports. The stylized facts for Peru�s economy show a growing level of trade integration. Peru�s trade as a percentage of GDP was around 32.5% in 1994-2002 and 49% in 2002-2018. China and the U.S. are the main destinations for Peru�s exports (27% and 16% of total exports in 2018, respectively). Total exports can be broken down mainly into commodities and intermediate goods (50% and 32% in 2018, respectively). Additionally, Peru�s de facto1 and de jure2 �nancial integration indicators have performed well. Total external assets (excluding reserves and external liabilities) as percentage of GDP were around 88% in 1994-2008 and 106% in 2009-2018. The de jure �nancial openness indicator shows that Peru has respected free capital movements since 1997. In contrast with China�s predominance in the trade channel, the U.S. is Peru�s main portfolio investment destination and its main source of direct investment. In this context, movements in the Fed policy rate have implications for Peru�s security market and �nancing costs for new investment projects. Regarding the nominal channel, commodity prices evolved exponentially in 2000-2014, with a cumulative 72% increase in the S&P GSCI. Cumulative growth for metal commodities (mainly copper) was 235% over that period, mainly driven by the industrial push in countries like China and India. Exports of other commodities, like gold, silver, and zinc, also grew considerably. This study seeks to examine empirically the e¤ect and evolution of external shocks and their transmission to output growth, in�ation, and the interest rate in Peru. Our speci�cation considers three transmission channels (real demand, the �nancial channel, and the nominal channel). The period of analysis is 1994Q1-2019Q4, which captures a number of international events, like the 1998 and 2008 crises and the Asian and Russian �nancial crises, as well as episodes of high domestic 1We consider the de facto �nancial measure proposed by Lane and Milesi-Ferretti (2007), who use the amount of external assets and liabilities as indicator. 2We use the index proposed by Chinn and Ito (2008), which considers information about legal restrictions on capital �ows in each economy as de jure measure. uncertainty caused by the 2001 political crisis and the 2006 and 2011 presidential elections.3. This period of analysis also captures the adoption of in�ation targeting (IT) by the Central Reserve Bank of Peru (BCRP) in 2002. In sum, evolving developments throughout Peru�s recent history tend to modify the underlying economic parameters. For instance, global �nancial integration has increased over time, thereby exacerbating Peru�s exposure to external shocks. In our view, a VAR methodology with regime-switching and stochastic volatility (RS-VAR-SV), following Chan and Eisenstat (2018), properly addresses this issue. The results indicate that the best �t for Peru is a VAR model with constant coe¢ cients and regime-switching variances (RS-VAR-SV-R1) instead of a traditional VAR with constant coe¢ cients (CVAR) and other restricted RS-VAR-SV models. Additionally, we identify two regimes before and after 2002, the pre- and post-IT regimes, where the latter is more persistent. Regarding the response of domestic variables to external shocks, China�s growth has the most signi�cant impact on domestic growth; i.e., a 1% China growth shock results in a 0.8% increase in domestic growth after one year. In contrast, a 1% surge in �nancial shocks has a contractionary impact on growth (a 0.3% fall after one year). Another interesting result is the increasing uncertainty around external shocks in predicting growth under regime 2; i.e., 70% of growth variability, mainly resulting from China growth shocks (34%) and commodity price shocks (30%). Regarding the historic contribution of external shocks, we underscore that the contribution of a China growth shock to the increase in domestic growth under regime 2 was considerable (89%). Moreover, the regime change shows that lower interest rates and in�ation under regime 2 are explained by the moderation of monetary shocks. The remainder of the paper is divided as follows. Section 2 provides a comprehensive review of the literature on external shocks in emerging market economies (EMEs).4 Section 3 describes the methodology used to estimate the model, the estimation algorithm, and the selection criterion proposed by Chan and Eisenstat (2018). Section 4 presents the data, the identi�cation scheme, the priors, the selection of models, the model�s regimes, the analysis of the impulse-response functions (IRFs), the forecast error variance decomposition (FEVD), and the historical decomposition (HD). Finally, Section 5 discusses the robustness exercises and Section 6 presents the conclusions. 2 Literature Review Mendoza (1995) uses a real business cycle (RBC) model to show that the contribution of terms-of- trade shocks on growth variability in developing countries is 50%. Ho¤maister and Roldos (1997) and Ho¤maister et al. (1997) estimate a VAR panel model with long-term restrictions; and show that terms-of-trade shocks have a greater impact on the balance of payments than on output in Asia and Latin America. Using an RBC model, Kose (2002) also �nds that external trade shocks explain around 45% of aggregate output �uctuations; and that �nancial shocks have a lower impact on developing economies. For Latin America, Ahmed (2003) uses a panel VAR model to estimate that terms-of-trade and 3Ollanta Humala�s presidential bid on a radical agenda, intended to replace the free market system with a socialist regime, created considerable domestic uncertainty in the 2006 and 2011 elections. Defeated by Alan García in 2006, Humala prevailed over Keiko Fujimori in 2011, although he became more moderate and respected the free market economy. 4This document focuses on EMEs, although there is also literature on developed countries; see Lubik and Teo (2005), Cesa-Bianchi et al. (2013), Charnavoki and Dolado (2014), and Dungey et al. (2020), among others. 1 U.S. real interest rate shocks explain 6% and 10% of output growth variability, respectively. Under the same methodology, Broda and Tille (2003) use data for 75 developing countries to show that the terms of trade explain 33% of output variability in economies with a �xed exchange rate regime, vis-à-vis less than 13% in economies with a �exible exchange rate regime. Canova (2005) shows that U.S.-originated supply- and demand-side shocks do not have a sig- ni�cant in�uence on �uctuations in domestic variables (output, the interest rate, and the exchange rate) in Latin America; but Fed monetary shocks induce considerable responses; i.e., the �nancial channel plays an important role in magnifying business cycles in Latin America. Additionally, U.S.- originated shocks explain 43% of variability in monetary variables (interest rates and the exchange rate). Using a vector error correction model (VECM), Izquierdo et al. (2008) estimate the e¤ect of �nancial shocks (U.S. Treasury bills and the EMBI) and terms-of-trade shocks on output in Latin American countries for 1990-2006; and show that growth in these countries is not sustained and is conditioned by external commodity price shocks or interest rate shocks, as during the 1998 Russian Crisis and the 2002-2006 commodity boom. For Argentina, Lanteri (2008) uses a VAR model with short-term restrictions to assess the impact of commodity price shocks on growth in output and �scal variables; i.e., 19% and 27% of variability in real output and tax revenues, respectively. Additionally, Castillo and Salas (2010) estimate a VAR model with common stochastic trends and cointegration restrictions for Peru and Chile, evidencing that the contribution of permanent external shocks is greater for output, consumption, and investment �uctuations; and that transitory shocks are relatively more relevant for consumption and investment than for output. Campos (2015) uses a VAR model with sign restrictions to assess the impact of terms-of-trade shocks on output and in�ation in Argentina, concluding that they a¤ect the latter to a greater extent. For the same country, Drechsel and Tenreyro (2018) use a dynamic stochastic general equilibrium (DSGE) model to �nd that external shocks represent 38%, 42%, and 61% of variability in output, consumption, and investment, respectively. For several EMEs, Shousa (2016), Fernández et al. (2018) and Fernández et al. (2017, 2020) show that commodity prices create greater output and investment volatility than in advanced countries. Additionally, Pedersen (2019) concludes that a positive shock on the price of copper results in a positive impact on Chile�s economic activity, as long as it originates on the demand side. On one side, Schmitt-Grohé and Uribe (2018) show that exchange rate shocks explain 10% of output variability on average in EMEs. In contrast, Fernández et al. (2020) assure that 50% of the variability of output is explained by world shocks (commodity shocks and interest rate shocks). For Peru, Dancourt et al. (1997) identify a high correlation between recession episodes and an external shock indicator. Nolazco et al. (2016) model di¤erent external shocks and their endogenous propagation using a simultaneous equation system, showing that the impact of external shocks on output growth is around 36% and 28% in 2005-2008 and 2010-2013, respectively. Additionally, Mendoza and Collantes Goicochea (2017) use an SVAR model with long-term restrictions to show that external shocks explain over 60% of real output variability. Rodríguez et al. (2018) use a model with common trends and cointegration to show that long- term output volatility is almost fully explained by terms-of-trade movements. They also use the HD for output growth to evidence that external factors are its main component. In the same line, Florián et al. (2018) estimate SVAR models to highlight the relevance of anticipated over unanticipated terms-of-trade shocks in explaining output variability (50% versus just 25%, respectively). 2 The IMF (2019) estimates the e¤ects from the recent U.S.-China trade wars on Latin American economies. Using a global VAR (GVAR) model (Pesaran et al. (2004) and Dées et al. (2007)), they show that the e¤ects are asymmetrical across countries, conditional on the degree of trade integration with the U.S. and China. Along these lines, Peru and Chile are a¤ected mostly by China via the trade channel and commodity prices, while Mexico and Brazil are a¤ected by the U.S. via the �nancial channel. Recently, Ojeda Cunya and Rodríguez (2022) used a family of models with time-varying parameters and stochastic volatility (TVP-VAR-SV) to explain the role of external shocks in Peru�s economic �uctuations. Based on this methodology, they �nd further evidence of the importance of commodity price shocks and their asymmetric impact over time on output growth, in�ation, and the interest rate. Rodríguez and Vassallo (2022) expand the four-variable model proposed by Ojeda Cunya and Rodríguez (2022) to seven variables; and characterize the dynamics of external shocks via di¤erent propagation channels (the U.S.-China real demand channel, the �nancial channel, and the commod- ity price channel) on Paci�c Alliance (PA) countries. Their �ndings show that the participation of external shocks on output variability in Peru �uctuates between 35%-80% throughout the sample. Additionally, commodity price shocks create the most uncertainty in output forecasting. Guevara et al. (2022) use TVP-VAR-SV models with a mix of innovations to calculate the e¤ect of external shocks on Peru�s domestic dynamics. They conclude that shocks originated in its main trade partners (China and the U.S.) have the greater impact; and that volatility in domestic aggregates is explained mainly by external shocks (around 75%). This research adheres to the methodology used initially by Rubio-Ramirez et al. (2005) and Sims and Zha (2006), who estimate RS-VAR-SV models for assessing monetary policy and its impact on the European Union (EU) and the U.S., respectively. We note that they use a Bayesian method- ology (the Gibbs sampling algorithm), in contrast with the traditional approach (the expectation- maximization (EM) algorithm) used by Krolzig (1997). Along these lines, studies like Sims et al. (2008) and Lanne et al. (2010) underscore the importance of the Bayesian approach for estimating these kinds of models, in particular the e¢ ciency in computing models that use a large number of parameters to re�ect several regimes. Additionally, this approach facilitates inferences from the results; e.g., by standardizing the discussion on IRF calculation for these models (see Droumaguet (2012)). In this context, we follow the estimation methodology proposed by Chan and Eisenstat (2018), who consider a group of RS-VAR-SV models with di¤erent restrictions based on assump- tions about the time variation (or constancy) of intercepts across regimes, the contemporaneous coe¢ cients, the lagged coe¢ cients, and the variance matrix. In this regard, it is appropriate to use the family of RS-VAR-SV models to address the non- linear relationship between external shocks and �uctuations in domestic macroeconomic aggregates, in contrast with the literature on external shocks described above. Additionally, we calculate and examine in detail the IRFs, FEVDs, and HDs for each RS-VAR-SV model. Another distinctive feature is the broad speci�cation of external shocks (similar to Rodríguez and Vassallo (2022)), for which we consider three channels of transmission to the Peruvian economy (the trade, �nancial, and price channels). In sum, our estimations are based on a seven-variable model (four external and three domestic), validated by several robustness exercises. 3 3 Methodology 3.1 Models Using the notation in Chan and Eisenstat (2018), we use a class of regime-switching VAR with heterocedasticity (RS-VAR-SV) models similar to those in Sims and Zha (2006). Let St 2 f1; : : : ; rg represents the regime indicator at time t and r is the number of regimes. Then, the RS-VAR-SV model is: B0Styt= �St+B1Styt�1+ � � �+BpStyt�p+�t; �t � N (0;�St) ; (1) where �St is an n�1 vector of intercepts, B1St ; : : : ;BpSt are n�n matrices of structural coe¢ cients, B0St is a triangular inferior matrix with unit values on the diagonal, also referred to as the matrix of contemporaneous relationships, and�St = diag(� 2 1St ; � � ��2nSt ) is an n�n diagonal matrix containing the variances of the structural shocks. The St index is a non-observable state following a Markov process with transition probability P (St = jjSt�1 = i) = pij . We can represent equation (1) using the three groups of parameters: yt = �St+ eXt�St+Wt St+�t; �t � N (0;�St) ; (2) where �St ;�St ; j have dimensions k�; k� ; k respectively. Additionally, the lagged variables are contained in eXt= In (1;y0t�1; : : : ;y0t�p), and the n� k matrixWt contains the elements of �yt. In order to jointly estimate the parameters, we group them as follows: yt = Xt�St+�t; �t � N (0;�St) ; (3) where the vector of parameters �St = (� 0 St ;�0St ; 0 St )0 has a dimension of k� = k� + k� + k . In addition to the unrestricted model RS-VAR-SV, several restricted models similar to those used by Rubio-Ramirez et al. (2005) and Sims and Zha (2006) are considered: (i) the RS-VAR- SV-R1 model restricts all coe¢ cients except for �St ; (ii) the RS-VAR-R2 model restricts only �St ; (iii) the RS-VAR-SV-R3 model restricts (B0St ;B1St ; : : : ;BpSt ) and allows time-variation for �St and �St ; (iv) the RS-VAR-SV-R4 model restricts B0St and allows time-variation in the remaining coe¢ cients; (v) the RS-VAR-SV-R5 model restricts (�St ;B1St ; : : : ;BpSt ); and (vi) the CVAR model where all parameters are constant. 3.2 Estimation Algorithm: Gibbs Sampling To estimate the posterior parameters we use the Gibbs sampling algorithm, which consists in dividing the parameters in blocks and estimating each one separately, conditional on updating of the other blocks. We use the following notation: � = [�01; : : : ;� 0 j ] 0, � = [�01; : : : ;� 0 j ] 0, for j = 1; : : : ; r; y = [y01; : : : ;y 0 T ] 0 , S = [S01; : : : ; S 0 T ] 0 and P is the transition probability matrix. According to Sims et al. (2008), the posterior distribution p(�;�;S;PjYT ) is obtained sampling from the following conditional posterior distributions: (i) p(Sj�;�;P;y); (ii) p(Pj�;�;S;y); (iii) p(�j�;S;P;y) and (iv) p(�j�;S;P;y). Before to start the step 1, in order to speed the convergence of the algorithm, we begin with at least an approximate estimate of the peak of the posterior density as Sims and Zha (2006) suggest. To initialize the Markov Chain, we set S(0), such as it will divide the sample in symmetric 4 subsamples, depending on the number of regimes. In each subsample, we calculate �(0)and �(0) by OLS. Also, the value of the symmetric matrix P(0) satis�es that pij = 0:8 with i = j and pij = 1=(r � 1) with i 6= j. To implement the step (i), we use a multi-move Gibbs sampling method as in Kim and Nelson (1999), Sims et al. (2008) and Bianchi and Melosi (2017). The algorithm to calculate the �ltered and smoothed probabilities is: !tjt = !tjt�1��t 10(!tjt�1��t) , !t+1jt = P!tjt where !tjt are the �ltered probabilities and �t is the jth element of the conditional density p(ytjSt = j;yt�1;P;�St ;�St), the symbol � denotes element by element multiplication. To initialize the recursive calculation, we assume that the initial probability is 1=3. In the case of smoothed probabilities, !tjT , we consider the following algorithm: !tjT = !tjt� [P0(!t+1jT (�)!t+1jt)] where (�) denotes element by element division. To implement step (ii), the transition probabilities are independent of y and the other parame- ters of the model and we use a Dirichlet distribution according to Chib (1996). For each row we have: P(i; :) � Dir(�0 + �ij) where �ij denotes the number of transitions from state i to state j, and �0 is the value of the prior for this distribution. Values for �0 are given in Section 4.3. To implement step (iii), we follow Chan and Eisenstat (2018): (�j jy;�;S;P) � N (b�j ;K�1 j� ) where the mean of the normal distribution is b�j= K�1 j� (V�1 � a� + X 0 j� �1 j Xj) and the variance is Kj�= V �1 � +X 0 j� �1 j Xj for j = 1; : : : ; r. Values for a� and V� are de�ne in Section 4.3. The step (iv) is implemented using the conditional distributions of the elements on the diagonal of �j for j = 1; : : : ; r: (�2j jy;�;S;P) � IG(�0+ T 2 ;S0+ 1 2 PT t=1(yjt�Xjt�j)2) where IG represents the Inverse Gamma distribution. Values for �0 and S0 are given in Section 4.3. Lastly, the steps from (i) to (iv) should be repeated N times, where N is the sum of burnings in sample and number of iterations. 3.3 Calculation of the Marginal Likelihood The Bayes Factor (BF) is a Bayesian measure for comparing models, de�ned as a ratio of marginal likelihoodsBFij = p(yjMi) p(yjMj) , where the marginal likelihood is p(yjMm) = R p(yj�m;Mm)p(�mjMm)d�m under model Mm; m = i; j. Chan and Eisenstat (2015) propose a more accurate and e¢ cient way to estimate the marginal likelihood based on importance sampling : bpIS(y) = 1 N NX n=1 p(yj�n)p(�n) g(�n) ; (4) where �1; : : : ;�N are independent draws obtained from the importance density g(:). The estimatorbpIS(y) meets the conditions of being consistent and unbiased, irrespective of the value of g(�n); however, it is sensitive to its variance. Therefore, for an optimal choice of g(:) with minimum variance, we use the cross-entropy method. If we denote this optimal importance density as g� and de�ne the posterior density as g� = g(�) = p(�jy) = p(yj�)p(�)=p(y), we obtain: bpIS(y) = 1 N NX n=1 p(yj�n)p(�n) g(�n) = 1 N NX n=1 p(yj�n)p(�n) p(yj�n)p(�n)=p(y) = p(y): Thus, for choosing g� we use a parametric family F = ff(�;v)g standardized by vector v, from which we obtain the importance density f(�;v�)2F that is closest to g�. The objective is �nding 5 v�ce such that it minimizes the cross-entropy distance between the optimal density and the chosen density f(�;v): = argmin fvg ( Z g�(�) log g�(�)d� � p(y)�1 Z p(yj�)p(�) log(�; v)d�): (5) As the �rst part of (5) does not depend on v, solving the minimization problem is equivalent to maximizing the second part, whose estimator is: bv�ce = argmaxfvg 1 L LX l=1 log(�l;v); (6) where �1; : : : ;�L are the draws obtained from the posteriors. In sum, the algorithm is divided into two parts: (i) obtaining the �1; : : : ;�L draws from the posterior density g�(�) = p(�jy) _ p(yj�)p(�) and seeking a solution for (6); and (ii) generating a random sample �1; : : : ;�N from the f(:; bv�ce) density and estimating the marginal likelihood using the estimator proposed in (4). 4 Empirical Results This Section describes the variables used, the identi�cation scheme, the priors used in the estima- tions, the regimes identi�ed, and the calculation of the IRFs, FEVDs, and HDs for the RS-VAR-SV models. 4.1 Data Figure 1 shows the quarterly data5 as growth rates for all variables except international and domes- tic interest rates. The sample covers 1994Q1-2019Q4, with data drawn from the BCRP, Bloomberg, Gruss and Kebhaj (2019), and the Federal Reserve Bank of St. Louis. The model uses two blocks of variables. The �rst one comprises four external variables representing trade, �nancial, and price shocks (see Han (2014), Nolazco et al. (2016), and Rodríguez and Vassallo (2022)): U.S. output growth (yUSAt ), the Fed�s policy rate (i�t ), China�s output growth (y CHN t ), and the export price in- dex growth (p�t ). The second block is made up of three domestic aggregates: Peru�s output growth (yPERt ), the in�ation rate (�PERt ), and the interest rate (iPERt ). The external variable block is modeled parsimoniously, such that trade shocks are represented by movements in yUSAt and yCHNt . In this regard, Canova (2005), IMF (2014), and Kose et al. (2017) show that Peru is one of main trading partners of the U.S. among EMEs, with Peru�s exports to the U.S. amounting to around 3.3% of GDP. At the same time, Han (2014), Nolazco et al. (2016) and IMF (2019) show that Peru�s exports to China represent around 6.2% of GDP, twice as much as exports to the U.S. Figure 1 shows that yUSAt is stable throughout the sample, with sharp falls associated with the 2001 dot.com crash and the 2008 Global Financial Crisis (GFC). In contrast, yCHNt is a more volatile series, particularly in 1994-2009; i.e., China�s high-growth period propelled by industrial development and trade integration. From 2009, yCHNt decelerates through 2019, with lower volatility than during the �rst period. We use p�t to model external shocks transmitted via the price channel, consisting mainly of the prices of metal commodities (copper, gold, and zinc). Peru was the world�s �rst copper producer 5The series in levels were seasonally adjusted using Tramo-Seats, as proposed by Gómez and Maravall (1996). 6 (12% of global production) and second zinc producer (11% of global production) in 2019. Figure 1 shows that p�t has a growing trend in 2000-2008, in line with the commodity supercycle, but decelerates in 2009-2019. Additionally, p�t volatility is lower in 1994-2002 than in 2003-2019. Along these lines, the standard deviation in the second period (around 20.5%) is twice as large as in the �rst one. Finally, �nancial shocks are represented by i�t , which is subject to U.S. monetary policy and has a direct in�uence on Peru�s short-term dollar interbank interest rate; i.e., both rates are highly correlated (0.7 in 1994-2019). The impact of this shock is directly re�ected in dollar loans (27% of total credit to the private sector). We highlight that private credit has increased with greater �nancial development in recent years (42% of GDP). Figure 1 shows that, in the wake of �nancial crises, i�t rose to levels below 2%; in particular, i � t remained around zero after the GFC. When we calculate the standard deviation of yPERt , �PERt and iPERt during the period 1994-2002 (4.5%, 7.3%, 5.3%, respectively) and the subsample 2003-2019 (2.7%, 1.3%, 1.1%, respectively), we evidenced a marked decrease in the volatility of these variables. This fact is associated with Peru�s exposure, during 1994-2002, to di¤erent international crises, idiosyncratic shocks6, and a monetary policy regime di¤erent from the current one. During 2003-2019, Peru was still exposed to external shocks, but with an IT regime adopted by the BCRP, which played a fundamental role in stabilizing the di¤erent shocks to the economy; see, for instance, Portilla et al. (2022). 4.2 Identi�cation Scheme The identi�cation of the structural model involves ordering the variables recursively from the most exogenous to the most endogenous: yt = (yUSAt , yCHNt , i�t , p � t , y PER t , �PERt , iPERt )0. This assumes that yUSAt is not a¤ected contemporaneously by shocks from other variables. This assumption is based on Kose et al. (2017), who �nd evidence of the considerable in�uence of the U.S. on both advanced countries and EMEs. We also assume that U.S. decisions directly a¤ect yCHNt ; and that later the contemporaneous response of i�t is a¤ected by y USA t and yCHNt shocks. The contemporaneous response of p�t is a¤ected by y USA t , yCHNt , and i�t shocks, as proposed by Roache (2012). Moreover, domestic variables like yPERt are a¤ected contemporaneously by all shocks from the external variable block; i.e., �PERt is a¤ected by contemporaneous external shocks and by yPERt . Finally, iPERt responds contemporaneously to shocks from all variables in the system. 4.3 Priors First, priors for estimating � follow a Gaussian distribution � � N (a�;V�), where a� = 0, V� = 10 � Ik� . Second, priors for estimating the variance follow an Inverse Gamma distribution �j = diag(�21j ; : : : ;� 2 nj), for i = 1; : : : ; n and j = 1; : : : ; r; where �2i � IG (�0;S0) and �0 = 5, S0 = (�0 � 1)� In. Third, the transition probabilities follow a Dirichlet distribution which depends on parameter (�0), according to Sims and Zha (2006) this parameter should be settled on �0 = 2�1r to generate an agnostic symmetrical prior distribution. 6The international crises during 1994-2002 were the Tequila crisis (1994), the Asian and Russian crises (1997- 1998), and the dot.com crash (2001). On the other hand, the idiosyncratic shocks were associated with the El Niño Phenomenon (1998) and political crisis (2001). 7 4.4 Results Following Bijsterbosch and Falagiarda (2015), Table 1 presents three tests assessing the presence of time-varying parameters in the matrix of contemporaneous relationships (B0t), the coe¢ cients of lags and intercepts (Bit), and the variance matrix (�t) in a TVP-VAR-SV model with one lag, selected using the Bayesian Information Criterion (BIC) (as in Rodríguez and Vassallo (2022)). First, in line with Cogley and Sargent (2005), the trace test assesses whether the trace of the prior for �t is signi�cantly less than the posterior for �t. Second, the Kolgomorov-Smirnov test evaluates whether each set of parameters can be obtained from the same continuous distribution. Third, the t-test establishes whether the mean of the two random samples belongs to the same distribution. In general, our results provide evidence of time-varying parameters. In particular, the trace test is estimated at 0.28, which is less than the value of the prior in the 50% and 84% percentiles. The other tests are calculated for two sub-samples, 1994Q2-2003Q4 and 2004Q1-2019Q4. The Kolgomorov-Smirnov test and the t-test show that 100% of the parameters in �t change between both sub-samples. Regarding the coe¢ cients in Bit and B0t , the Kolgomorov-Smirnov test shows evidence that 90% of the parameters in Bit and 76% of the parameters in B0t vary over time. Likewise, the t-test shows that, in both sub-samples, around 87% of the parameters in Bit and 100% of the parameters in B0t vary over time. 4.4.1 Selection of the Best-Fitting Model Table 2 shows the log-marginal likelihoods for the RS-VAR-SV models with one lag (p = 1)7 and di¤erent regimes. We highlight two comments from these results. First, compared with the CVAR model, the RS-VAR-SV model provides a much inferior �t; speci�cally, the BF in favor of the former is 1:8� 1024. However, this result changes when only the volatilities across regimes are allowed to vary. Along these lines, the RS-VAR-SV-R1 model provides a better �t than the CVAR model, with a BF of 1:3 � 1025, indicating that the highest gain in �t results from SV inclusion. Indeed, comparing a model with a constant variance matrix (RS-VAR-R2) with the RS-VAR-SV model, the BF for the latter is 1738, indicating a better �t. Additionally, the RS-VAR-SV-R1 model is a better �t than the restricted versions of the RS-VAR-SV model (RS-VAR-SV-R3, RS-VAR-SV-R4, and RS-VAR-SV-R5). Therefore, our results suggest that models with SV and constant coe¢ cients across regimes provide a better �t compared with models where all coe¢ cients are time-constant or time-varying. This �nding is in line with Ojeda Cunya and Rodríguez (2022), Rodríguez and Vassallo (2022), and Guevara et al. (2022), who indicate that models with SV and changing intercepts �t better for Peru. Second, the results suggest that the number of regimes estimated within each RS-VAR-SV model also a¤ects the goodness of �t. In general, models with two regimes (r = 2) are largely favored by the data; e.g., comparing the RS-VAR-SV-R1 model with two regimes vis-à-vis the same model with three and four regimes (r = 3 and r = 4), the BFs favoring the �rst model are 5260 and 4:4� 106, respectively. 7The number of lags (p) is selected using the Schwarz Information Criterion (SIC) applied to a CVAR. We also perform a Bayesian estimation of the CVAR model with p = 1; 2; 3, where the BFs are 1:06 � 1032 and 3:94 � 1086 in favor of the model with p = 1 over those with p = 2 and p = 3, respectively. 8 4.4.2 Regimes in the Model Based on the results for the RS-VAR-SV-R1 model, we calculate the standard deviation of shocks associated with regime 1 and �nd that domestic variable shocks under the post-IT regime are less volatile than under the pre-IT regime; in particular, yPERt and �PERt shocks are 50% less volatile and iPERt shocks are 90% less volatile. Additionally, the standard deviation of yUSAt , yCHNt , and i�t external shocks under the post-IT regime are 10% lower than under the pre-IT regime, while the standard deviation of the p�t shock under the post-IT regime is 50% higher than under the pre-IT regime. Figure 2 shows the state probability for all models with two regimes.8 Two-regime models indicate a clear turning point between the pre- and post-IT regimes in 2002. Moreover, taking the RS-VAR-SV-R1 model as reference, we �nd that the duration of regimes 1 and 2 is 11 and 33 quarters, respectively, with greater persistence under the post-IT regime. 4.4.3 Analysis of Impulse-Response Functions (IRFs) In this section we discuss the IRFs of domestic variables (mainly Peru�s output growth) for external shocks (yUSAt , yCHNt , i�t , and p � t ); and calculate the IRFs for the pre- and post-IT regimes. To facilitate the interpretation of the results, we normalize the IRFs so that domestic variables respond to 1% external shocks. Figure 3 shows the IRFs of yPERt , �PERt , and iPERt for di¤erent external shocks under regimes 1 and 2.9 We note that, in all models, yPERt has a positive response to yUSAt , yCHNt , and p�t shocks and a negative response to i�t shocks, in line with theory; see Kose (2002). The di¤erences in responses between models are associated with magnitude and persistence. Based on the above premises, we can infer four general results regarding the response of yPERt : (i) the yUSAt and yCHNt shocks (real channel shocks) have a positive e¤ect on yPERt (0.3% and 0.8% after one year, respectively) and the yCHNt shock is more persistent than the yUSAt shock; (ii) the i�t shock (�nancial channel shock) has a negative and transitory impact (around 0.4%); (iii) the p � t shock (price channel shock) has a positive impact and the response is heterogenous depending on the model and the regime; and (iv) the responses to external shocks are more stable and similar to each other under the post-IT regime than under the pre-IT regime. Hereinafter we will focus on the RS-VAR-SV-R1 model with two regimes, which provides the best �t according to the BF. Figure 4 shows the responses of domestic variables to yUSAt , yCHNt , i�t , and p � t shocks within their respective 68% con�dence bands. Additionally, we take the IRFs for the CVAR model (red lines) as benchmark. a) U.S.-originated real external shocks: Column 1 in Figure 4 shows the response of domestic variables to a yUSAt shock. The response of yPERt is positive under both regimes, with a greater impact under regime 1. The responses of �PERt and iPERt are also positive and have a greater impact under regime 1. Moreover, we note that the responses of yPERt , �PERt , and iPERt are less persistent than with the CVAR model. 8We carry out the same analysis for the three-regime models (available on request). The results for these models show that the third regime in each model does not meet the rule of thumb proposed by Hamilton (1989); i.e., the estimated state probabilities do not exceed 0.5, implying that the third regime is not relevant to this study. 9 It should be noted that we omit the IRFs for regime 1 in the RS-VAR-SV and RS-VAR-SV-R2 models, as they show an unstable behavior. 9 The response of yPERt indicates a 0.3% expansion resulting from a 1% increase in yUSAt three quarters after the shock. However, in quarter 10 the response of yPERt contracts by 0.3% and dissipates by the �fth year. This mixed behavior is in�uenced by two opposing forces. The �rst one is associated with the trade channel; i.e., the expansion in yUSAt has a positive in�uence on Peru�s exports, the U.S. being one of its main trading partners. However, after a period of yUSAt expansion, rising prices in the U.S. would result in a Fed rate increase, in turn acting as a second, opposite force with a negative e¤ect on yPERt . The positive responses of �PERt and iPERt are associated with higher in�ation expectations in response to greater economic activity; i.e., expectations of higher interest rates for countering growing in�ation and external interest rate spreads. The response of yPERt under regime 1 is greater than under regime 2 due to Peru�s relatively lower post-IT trade trade dependence on the U.S., in line with Canova (2005) and IMF (2019); i.e., this lower signi�cance is associated with a lower U.S. share as commodity importer. b) China-originated real external shocks: Column 2 in Figure 4 indicates the IRFs of do- mestic aggregates for a yCHNt shock. The impact on yPERt is positive under both regimes, with a greater impact under regime 2, in contrast with the e¤ect of a yUSAt shock, as trade relations with China intensi�ed more than with the U.S. under the post-IT regime. The responses of �PERt and iPERt are in line with the response of yPERt . We underscore that responses in the CVAR model underestimate the e¤ects of external shocks under both regimes. The importance of China-originated shocks grew as China became Peru�s main commodity buyer in 2002 and surpassed the U.S. as main destination for Peru�s exports in 2011. In this context, yCHNt shocks have a considerable impact via greater demand for metal inputs and commodities. This result is explained mainly by China�s weight in the global commodity market and Peru�s role as a leading exporter of metal commodities (72% of exports to China are metal commodities). Additionally, greater demand for metal commodities increases their prices, resulting in higher dollar revenues from exports and appreciation pressures on Peru�s currency. Moreover, the positive outlook for the mining industry attracts investments in new exploration and exploitation projects, with China emerging as a leading investor in recent years. The response of yPERt to a 1% expansion in yCHNt reaches 0.8% after one year under the post-IT regime (a greater e¤ect than for yUSAt shocks) and remains signi�cant until year 2. It is worth noting that China-originated shocks also re�ect an indirect e¤ect from commodity prices, as suggested by Gruss (2014) and IMF (2019). Additionally, our results are in line with a recent report on the relevance of trade integration in Latin America and the Caribbean (World Bank (2019)), which estimates the elasticity of yPERt in response to a 1% yCHNt shock at 0.7%. Regarding the responses of �PERt and iPERt , we �nd that they become in�ationary starting quarter 4 as a result of greater momentum in domestic demand. In turn, this results in higher in�ation expectations, which prompts an expansionary iPERt response to o¤set in�ation pressures (Mendoza and Collantes Goicochea (2017)). Moreover, growing trade relations and integration into world commodity markets since 2002 changed the responses of �PERt and iPERt across both regimes; i.e., they are more in�ationary under regime 2. c) External �nancial shocks: Column 3 in Figure 4 shows the responses of domestic variables to an i�t shock. The contractionary response of y PER t increased under regime 2, con�rming that, during that period, U.S. �nancial shocks have a greater e¤ect on economic activity than U.S. real shocks. Theory predicts that this contractionary e¤ect results from increased returns on the dollar, 10 which in turn creates depreciation pressures on Peru�s currency and promotes capital out�ows. This e¤ect raises the cost of credit, which a¤ects �nancing of private investment and, therefore, yPERt . Additionally, the increase in i�t prompts a positive monetary policy response, which increases domestic interest rates. It should be noted that this e¤ect is also magni�ed under regime 2. Moreover, the results from the selected model are more persistent than those from the CVAR model. The 1% increase in i�t contracts y PER t by 0.5% in quarter 2; and is statistically signi�cant in the short run. Our results are in line with Mendoza and Collantes Goicochea (2017), who mention that, in response to capital out�ows, the price of �nancial securities drops; and, in turn, this wealth e¤ect depresses demand and output. Financial shocks have a greater impact than yUSAt shocks due to considerable U.S. direct and portfolio investments; see IMF (2019). Regarding the responses of monetary variables, we �nd that �PERt does not show a clear response; however, iPERt responds positively during the �rst quarters, con�rming the synchronicity between Peru�s monetary policy and Fed decisions. In sum, Peru�s greater participation in �nancial markets and increased access to credit by households and companies since 2002 resulted in a greater impact of �nancial shocks under regime 2. d) External commodity price shocks: Column 4 in Figure 4 indicates that the responses of yPERt to p�t shocks are positive (and larger under regime 2), as Peru became a leading producer of copper, zinc, silver, gold, and other minerals since the commodity price boom, coinciding with surging growth in China and the global economy (which propelled the demand for minerals since 2000). In this context, a positive p�t shock will result in greater revenues from exports and enhanced mining returns, in turn encouraging other investors to develop mining projects in Peru. Higher incomes result in improved income tax revenues (mainly mining canon revenues), which creates more �scal space to �nance public investment; see IMF (2015) and Jiménez and Rodríguez (2020). A positive 10% p�t impulse would increase growth by 0.5% in quarter 2 under regime 2 and then dissipate in one year; i.e., it would be a transitory shock. Its impact is comparatively low, in principle due to the presence of yCHNt in the model.10 Other studies, like Ojeda Cunya and Rodríguez (2022), �nd that a 10% increase in commodity prices results in a 1%-2% expansion in yPERt ; and Rodríguez and Vassallo (2022) suggest a response of around 1.1%. Despite the di¤erences in magnitude, our results con�rm the temporary nature of these shocks, as well as variation over time. We also �nd that the response of �PERt and iPERt is contractionary during the initial quarters. This fall is caused by greater dollar in�ows caused by the price e¤ect on exports, which in turn diminishes import prices and (via the pass-through e¤ect of the exchange rate) reduces in�ation. As the shock is temporary, monetary policy does not react signi�cantly. 4.4.4 Analysis of the Forecast Error Variance Decomposition (FEVD) Figure 5 shows the FEVD of yPERt , �PERt , and iPERt for 20 quarters, the two regimes in the RS- VAR-SV-R1 model, and the CVAR model. We consider yUSAt , yCHNt , i�t , and p � t external shocks, as well as aggregate demand (AD), aggregate supply (AS), and monetary policy (MP) domestic shocks. 10The Section on robustness exercises explains this issue in detail by comparing a model with p�t as sole external shock with another that considers both p�t and y CHN t : 11 The FEVD for output growth in Peru shows that, altogether, external shocks explain around 70% of yPERt �uctuations under regime 2; i.e., 40 percentage points (p.p.) higher than under regime 1. Greater uncertainty under regime 2 is associated with higher volatility in p�t and y CHN t shocks (30% and 34%, respectively), which increased considerably (by 19 p.p. and 16 p.p. relative to regime 1, respectively). The remaining volatility is explained by i�t and y USA t shocks (1% and 5%, respectively), which did not change substantially relative to regime 1. It should be noted that the yUSAt shock creates less uncertainty than the yCHNt shock, as China is closely related to Peru via the trade channel. Moreover, the stylized facts show that China�s output is more volatile than that of the U.S. Our empirical results are in line with Fernández et al. (2020) and Rodríguez and Vassallo (2022). Furthermore, Ojeda Cunya and Rodríguez (2022), and Guevara et al. (2022) �nd values of 65% and 80% for the contribution of external shocks to yPERt variability. The increased uncer- tainty of external shocks under regime 2 coincides with Peru�s greater trade integration with large commodity importers like China, and with the commodity price boom. Along these lines, Mendoza (2013) argues that the success of Peru�s economic model is mainly associated with extraordinary international events and only partially with sound short-run policies. We also �nd that AS, AD, and MP domestic shocks explain 70% of yPERt variability under regime 1, vis-à-vis 30% under regime 2. This 40-p.p. reduction is closely associated with improved monetary and �scal policies; i.e., the BCRP adopted IT in 2002 (see Portilla Goicochea and Ro- dríguez (2020)) and the Ministry of Economy and Finance (MEF) implemented �scal discipline (see Jiménez and Rodríguez (2020)). In particular, our results indicate that the contribution of an MP shock diminishes under regime 2; i.e., it explains 1% of yPERt variability (19 p.p. less than under regime 1). This result translated into more predictable monetary policy and greater con�dence in the BCRP�s decisions (see Castillo et al. (2016) and Portilla Goicochea and Rodríguez (2020)). The FEVDs for �PERt and iPERt indicate that external shocks explain 80% of variability in each variable under regime 2 (i.e., 60 p.p. and 70 p.p. increases relative to regime 1, respectively). In particular, this increase is in�uenced mainly by the p�t shock (66% and 70%, respectively), re�ecting the e¤ect of external shocks via the nominal channel on monetary variables. Additionally, i�t and yUSAt shocks signi�cantly a¤ect iPERt (8% and 20%, respectively) under the post-IT regime. In line with Canova (2005), Han (2014), and IMF (2019), our results re�ect the impact of international �nancing costs and the greater connection with the U.S. via the �nancial channel. At the same time, domestic shocks introduce greater volatility in �PERt and iPERt forecasts under regime 1 (63% and 89%, respectively), vis-à-vis 20% under regime 2. This result also con�rms the success of IT adoption, re�ected in lower �PERt uncertainty and greater iPERt predictability under the post-IT regime. The results for the CVAR model, vis-à-vis the RS-VAR-SV-R1 model, show that external shocks explain less than 60% of yPERt variability, 10 p.p. below the value predicted by the RS-VAR-SV-R1 model under regime 2. This result is associated with a lower contribution from the p�t shock (around 20 p.p.) and is replicated in the FEVDs for �PERt and iPERt . Another important result is that the contribution of the yUSAt shock to iPERt variability is 20 p.p. higher than the value predicted by the RS-VAR-SV-R1 model. In general, the FEVDs for the CVAR model depart from the literature (Rodríguez and Vassallo (2022); Guevara et al. (2022)). Therefore, SV omission in traditional (CVAR) models leads to underestimating the total e¤ect of external shocks on yPERt , �PERt , and iPERt , as well as the contribution of yCHNt , yUSAt , i�t , and p � t shocks on those domestic variables. 12 Moreover, AS, AD, and MP shocks in the CVAR model are more in�uential; in particular, we identify a greater contribution of the MP shock; e.g., the latter explains 40% of iPERt variability in quarter 4; i.e., 20 p.p. higher than estimated by the RS-VAR-SV-R1 model under regime 2. Therefore, the CVAR model fails to re�ect monetary policy moderation after IT adoption. 4.4.5 Analysis of Historical Decomposition (HD) Figure 6 shows the HD for yPERt , �PERt , and iPERt for the RS-VAR-SV-R1 and CVAR models, using the methodology proposed by Wong (2017). The HD for yPERt in the RS-VAR-SV-R1 model shows that yPERt increased from 4% under regime 1 to 5.1% under regime 2. The main driver of this 1.1-p.p. increase was the yCHNt shock, which explained 1.0 p.p. (around 89%). Another determinant of the increase in yPERt under regime 2 was the yUSAt shock, which contributed 0.3 p.p (around 25%). These results suggest that greater trade integration and free-trade agreements (FTAs) with Peru�s main trading partners was bene�cial, as they contributed to enhancing yPERt under the post-IT regime. In contrast with real shocks, the i�t shock had a negative impact on the increase in y PER t between regimes (a -0.1-p.p. contribution, around -5%). Similarly, the p�t shock explained -0.1 p.p. of the increase in yPERt between regimes. Despite the negative contribution of both shocks, they represent just -0.2 p.p (10%) of the increase, which is relatively low compared with the total contribution of the yCHNt and yUSAt real shocks. Regarding domestic shocks, the MP shock contributed considerably to the increase in yPERt (0.3 p.p., around 28.5%), re�ecting sound monetary policy implementation by the BCRP under regime 2. Additionally, the AS and AD shocks explained 0.5 p.p. (around 41%) of the di¤erence in yPERt between the pre- and post-IT regimes. The HDs for yPERt in the CVAR and RS-VAR-SV-R1 models coincide in that the yCHNt shock is the main factor explaining the increase in yPERt under regime 2. At the same time, the CVAR model estimates the contribution of the yUSAt shock at 0.7 p.p. of such increase (around 66%). Additionally, the CVAR model estimates that the MP shocks contributed -0.1 p.p. to the increase in yPERt under the post-IT regime (around -7%), which is not consistent with the stylized facts about the successful implementation of monetary policy under the post-IT regime. Using the HD for yPERt in the RS-VAR-SV-R1 model, we calculate the e¤ect of international crises on yPERt in speci�c periods. For 1998, we �nd that the mix of external shocks had a negative e¤ect on yPERt , coinciding with the Asian and Russian crises; see Castillo and Pereda (2009). Comparing yPERt for 1997-1998, we calculate that yPERt diminished by -6.8 p.p., of which external shocks explained -1.6 p.p. (around 23.4%). Additionally, the El Niño Phenomenon (at the beginning of 1998) destroyed �xed capital, reduced �shing production, and deteriorated exports; i.e., AS and AD shocks altogether contributed -5.3 p.p. (around 78%) to the fall in yPERt between 1997 and 1998. In the wake of the GFC, yPERt dropped from 9.2% in 2008 to 1.1% in 2009. The main driver of this 8.1-p.p. fall was the yCHNt shock (4.7 p.p., around 58%). Another important factor was the decline in U.S. growth, which contributed 1.4 p.p. (around 17.8%) to the fall. At the same time, via U.S. expansionary policy, the i�t shock attenuated the fall in y PER t (a -0.6-p.p. contribution, around -7.6%). A recent event to consider is the 2019 U.S.-China trade wars. Output growth in Peru decreased from 4.0% in 2018 to 2.2% in 2019. This 1.8-p.p. decline was explained mainly by yCHNt shocks (a 13 0.7-p.p. contribution, around 40%). Moreover, low commodity prices were transmitted via the p�t shock, representing 0.3 p.p. (around 15.4%) of the di¤erence in yPERt between 2018 and 2019. For its part, �PERt is 8% and 2.7% under regimes 1 and 2, respectively. The 5.3-p.p. decrease in �PERt is explained mainly by AS and MP shocks, which contributed 1.7 p.p. (around 31.6%) to the reduction. In contrast, the results for the CVAR model suggest that the MP shock was not important in reducing �PERt , which is not in line with the literature on sound monetary policy implementation in Peru; see Castillo et al. (2016) and Portilla Goicochea and Rodríguez (2020). The HDs for iPERt in the RS-VAR-SV-R1 are 13.7% and 3.7% under regimes 1 and 2, respec- tively; i.e., a 10-p.p. reduction, re�ecting successful IT adoption by the BCRP, and relying on the attenuation of the MP shock (4.2 p.p., around 41.5%). Like in the HD for �PERt , the CVAR model does not capture the importance of the MP shock in regime 2, as it estimates its contribution at 0.4 p.p.; i.e., around 4% of the reduction in iPERt between the pre- and post-IT regimes. 5 Robustness We perform seven robustness exercises on the model via the following modi�cations: (i) use of alternative priors; (ii) changes in external variables (i�t and p � t ); (iii) change in the ordering of domestic variables; and (iv)-(vii) estimation of the model using 4, 5, 6, and 8 variables. The IRFs, FEVDs, and HDs are calculated and assessed for each exercise. Table 3 shows the results.11 5.1 Changes in Priors The baseline estimations use the priors proposed by Chan and Eisenstat (2018), which are non- informative. In this regard, the �rst robustness exercise consists in assessing the sensitivity of our results with a set of priors that use OLS estimations for a training sample covering 1994-2004 and comprising 40 observations, like Primiceri (2005). We use the information in Table 3 to calculate the BF, which clearly favors the RS-VAR-SV-R1 model with two regimes; e.g., the BFs between the RS-VAR-SV-R1 model with two regimes (r = 2) and the CVAR and RS-VAR-SV models with two regimes (r = 2) are 5.1�1023 and 9.3�1047, respectively. Columns 1 and 2 in Figure 7 show the IRFs of yPERt under regimes 1 and 2 in the RS-VAR-SV- R1 model for yUSAt , yCHNt , i�t , and p � t shocks. The results do not indicate changes in the direction of responses relative to the baseline model. Despite this similarity, yCHNt shocks di¤er slightly from the baseline model; and the responses to i�t are non-signi�cant for a 68% con�dence interval. These results suggest that the baseline model with non-informative priors can replicate the stylized facts on the Peruvian economy. From the FEVD analysis (Figure 8) we �nd that external shocks explain 60% of yPERt variability under regime 2, vis-à-vis less than 20% under regime 1. As in the baseline model, the main sources of uncertainty in predicting yPERt are the p�t and y CHN t shocks (although, compared with the baseline model, the latter is 20 p.p. lower in quarter 4). With the alternative priors, the di¤erences in the CVAR and RS-VAR-SV-R1 models remain as in the baseline estimation. Figure 9 shows the HD for yPERt , indicating that the increase in yPERt from regime 1 to regime 2 is 1.1 p.p., of which -0.5 p.p. (around -43.7%) were explained by the p�t shock; and the i � t shock 11Table 3 shows only the log-marginals for the RS-VAR-SV models with r = 2 in each robustness exercise. We also calculated the log-marginals for the RS-VAR-SV models with r = 3 and r = 4, evidencing that the RS-VAR-SV models with r = 2 are the best �t in all robustness exercises. The estimations of the log-marginals with r = 3 and r = 4 are available on request. 14 contributed 0.1 p.p. (around 11%). Moreover, although these results di¤er from the baseline model, the results for the yCHNt and yUSAt external real demand shocks preserve a joint contribution of 1.3 p.p. (around 119%), evidencing their importance in explaining the increase in yPERt under regime 2, as in the baseline model. As in the FEVD exercise, we �nd that the CVAR results with alternative priors are similar to the CVAR of the baseline estimates. 5.2 Change of Variables The second robustness exercise consists in changing the variables for the �nancial and price channels. That is, i�t is changed for a similar variable, the shadow interest rate (i SR t ), calculated by Wu and Xia (2016); and p�t is changed for Goldman Sachs�s global commodity index, the S&P GSCI (p SP t ). It should be noted that, within the empirical literature for Peru, Flores (2016) used iSRt as an alternative to i�t ; and Ojeda Cunya and Rodríguez (2022) and Rodríguez and Vassallo (2022) used pSPt in their estimations. As in the previous exercise, the RS-VAR-SV-R1 model with two regimes is a better �t compared with the other models. Table 3 shows that the BFs between the RS-VAR- SV-R1 model with two regimes (r = 2) and the CVAR and RS-VAR-SV models with two regimes (r = 2) are 2.15 and 2.7�1064, respectively. Columns 1 and 2 in Figure 10 show the IRFs of yPERt for an iSRt shock under regimes 1 and 2. These results indicate that the response of yPERt is a 0.3% contraction in quarter 2, as in the baseline model. Regarding the pSPt shock, we �nd the responses of yPERt to be non-signi�cant and without a clear direction. This result is in�uenced by the structure of the S&P GSCI, which includes the prices of oil and other commodities imported by Peru. Therefore, this shock involves opposite-direction export and import price e¤ects on yPERt . The FEVD analysis (Figure 11) indicates that external shocks contribute 78% of yPERt variabil- ity under regime 2; i.e., over 10 p.p. more than in the baseline model. However, the composition of external shocks remains similar relative to the baseline model. Regarding the iSRt shock, we �nd that it contributes 10% to yPERt variability under both regimes, similar to the contribution of i�t in the baseline model. Additionally, we �nd that the p SP t shock contributes 47% to yPERt variability under regime 2; i.e., 17 p.p. more than the contribution of p�t in the baseline model, as pSPt comprises more volatile commodities, like oil and natural gas. Figure 12 shows the HD for yPERt , which evidences that the yCHNt shock contributed 1.4 p.p (around 122%) to the 1.1-p.p. increase in yPERt between regimes 1 and 2; and the yUSAt shock contributed 0.6 p.p (around 50%). These results are in line with the baseline model, as real shocks, particularly the yCHNt shock, were the main driver of the increase in yPERt under the post-IT regime. The iSRt and pSPt shocks contributed 0.2 p.p. (around 19%) to that increase, which di¤ers from the baseline model. However, as in the latter, these shocks made a low contribution to the increase in yPERt under regime 2. On the other hand, the calculations of the IRFs, FEVD and HD of the CVAR model also replicate the results of the estimates of the baseline model. 5.3 Change in the Ordering of Variables The third robustness exercise estimates the baseline model with an alternative ordering of domestic variables. Following Mendoza and Collantes Goicochea (2017), we consider yPERt and it as the most endogenous and most exogenous domestic variables in the system, respectively. Therefore, the ordering of the variables would be as follows: yt = (yUSAt , i�t , y CHN t , p�t , i PER t , �PERt , yPERt )0. As 15 our models follow a recursive ordering, we perform this robustness exercise to verify the sensitivity of our results to a change in the ordering of variables. Despite the latter, the RS-VAR-SV-R1 model continues to be the best �t relative to the other models. Based on the results in Table 3, the BFs between the RS-VAR-SV-R1 model with two regimes (r = 2) and the CVAR and RS-VAR-SV models with two regimes (r = 2) are 3.9�1039 and 2.6�1041, respectively. The IRF analysis (columns 1 and 2, Figure 13) indicates that the response to yUSAt preserves the same expansionary/contractionary behavior as in the baseline model. Responses to the yCHNt shock continue to be persistent. Responses to the i�t shock are contractionary and transitory; and responses to the p�t shock are expansionary and transitory. Therefore, the change in the ordering of domestic variables does not modify the results for the baseline model under either regime, and the CVAR model. Figure 14 shows the FEVD for yPERt , which indicates that external shocks explain 70% of yPERt variability; and the composition of external shocks is similar to the baseline model; i.e., p�t and y CHN t shocks continue to create the most uncertainty in yPERt forecasts. Moreover, domestic (especially MP) shocks moderate under the post-IT regime; i.e., their contribution to yPERt variability decreases from 25% to 1%, in contrast with the pre-IT regime. The HD results for yPERt (Figure 15) indicate that the contribution of external shocks does not change relative to the baseline model; and that real yUSAt and yCHNt shocks contribute the most to the increase in yPERt . Regarding domestic shocks, the results are similar as for the baseline model; e.g., the AS shock contributed 0.3 p.p. (around 32%) out of 1.1 p.p. to the increase in yPERt between regimes 1 and 2. In both the FEVD and HD of this robustness exercise, the results for the CVAR model are similar to those of the base model. 5.4 Four-Variable Model The next robustness exercise uses only one external variable (p�t ) while preserving the three domestic variables in the baseline model. This speci�cation resembles the one used by Ojeda Cunya and Rodríguez (2022), except that we use p�t as external variable instead of p SP t . It should be noted that the RS-VAR-SV-R1 model with two regimes is widely favored by the BF relative to the other models; e.g., Table 3 shows that the BFs between the RS-VAR-SV-R1 model with two regimes (r = 2) and the CVAR and RS-VAR-SV models with two regimes (r = 2) are 4.2�1045 and 9.5�1020, respectively. Row 1 in Figures 16 (regime 1) and 17 (regime 2) shows the IRFs for yPERt , which are positive under both regimes; and the 1% and 2% responses of yPERt to a 10% p�t shock under regimes 1 and 2, respectively, are highly signi�cant. Additionally, shocks under regime 2 are less persistent, as they dissipate in �ve quarters, in contrast with two years under regime 1. For this speci�cation, the CVAR model only estimates a response similar to regimen 2. Row 1 in Figure 18 shows the FEVD for yPERt , indicating that the p�t shock explains 60% of yPERt variability under regime 2, in contrast with 8% under regime 1. For their part, domestic shocks are less volatile under regime 2, particularly the MP shock, which explains less than 5% of yPERt variability, in contrast with 30% under regime 1. This result re�ects the moderation of the BCRP�s monetary policy; see Portilla Goicochea and Rodríguez (2020). In the results of the CVAR�s FEVD model, the contribution to the variability of yPERt only reaches 50%. The HD results for yPERt (row 1, Figure 19) show that the p�t shock contributed -0.02 p.p. out 16 of a 1.1-p.p. increase in yPERt between regimes 1 and 2 (around -2%); and that domestic shocks contributed 1.6 p.p. (around 140%) of that increase. In principle, these results seem to clash with the �ndings for the baseline model regarding the role of external shocks. However, the model also considers that nominal external shocks have not been determinant for output growth under regime 2; and that real shocks (e.g., from yCHNt ) contributed the most to yPERt growth between regimes. As this model considers p�t as the only external variable, it underestimates the total e¤ect of external shocks. Moreover, the greater contribution of domestic shocks is mainly associated with MP shocks, re�ecting the BCRP�s sound implementation of monetary policy under regime 2; see Castillo et al. (2016) and Portilla Goicochea and Rodríguez (2020). The CVAR and RS-VAR-SV-R1 models do not have many di¤erences to explain the contribution of external shocks through the sample. 5.5 Five-Variable Model We modify the previous model by adding the e¤ect of �nancial shocks (i�t ), so that the external block now comprises variables p�t and i � t , and the domestic block preserves the same variables. The ordering considers i�t as the most exogenous variable, under the assumption that U.S. monetary policy has a more exogenous e¤ect on commodity prices (Frankel (2014)). Similarly to the previous exercise, the BF indicates that the RS-VAR-SV-R1 model with two regimes is a better �t compared with the other models. Table 3 shows that the BFs between the RS-VAR-SV-R1 model with two regimes (r = 2) and the CVAR and RS-VAR-SV models with two regimes (r = 2) are 2.4�1042 and 8.4�1027, respectively. Row 2 in Figures 16 (regime 1) and 17 (regime 2) shows the IRFs for yPERt , which indicate that the p�t shock is expansionary and transitory under both regimes, with a higher e¤ect under regime 2. Additionally, the magnitude of this shock is similar as in the four-variable model. For their part, the responses of yPERt to an i�t shock do not show a clear direction, as the i � t shock picks up information form other unidenti�ed channels. For the CVAR model, the response of yPERt to the shock of p�t is similar to that of regime 2; however, the response to the shock of i � t is negative and very persistent, di¤erent from the base model. Column 2 in Figure 18 shows the FEVD for yPERt , which indicates that external shocks explain 60% of yPERt variability under regime 2 and less than 5% under regime 1. Moreover, most of the variability is explained by the p�t shock under both regimes. Regarding domestic shocks, we �nd that the MP shock explains 40% of yPERt variability under regime 1 (up 10 p.p. relative to the four-variable model) and 1% under regime 2. In this speci�cation, the FEVD of the CVAR model for external shocks is similar to the 4-variable model. The results for the HD (row 2, Figure 19) evidence that i�t shocks contributed -0.3 p.p. (around -25%) to the increase in yPERt between regimes 1 and 2. Additionally, the MP shock contributed 1.9 p.p. (around 172%) to the increase in yPERt , indicating that monetary policy was instrumental in o¤setting the negative e¤ects from nominal and �nancial shocks under regime 2. Moreover, as this exercise considers only �nancial and nominal shocks, monetary policy takes on a greater role in attenuating their e¤ects under regime 2, which is in line with the BCRP�s solid monetary policy implementation under the post-IT regime. For the CVAR model, the HD is similar on external shocks to the RS-VAR-SV-R1 model, but it does not capture monetary policy shocks. 17 5.6 Six-Variable Model In this robustness exercise we add yCHNt to the external block and consider yCHNt as the most exogenous variable, given China�s increasing role in global �nancial and commodity markets. Ad- ditionally, the BF results show that the RS-VAR-SV-R1 model with two regimes is the best �t (Table 3); e.g., the BFs between the RS-VAR-SV-R1 model with two regimes (r = 2) and the CVAR and RS-VAR-SV models with two regimes (r = 2) are 6.8�1041 and 6.8�1037, respectively. The IRFs for yPERt in row 3 of Tables 16 (regime 1) and 17 (regime 2) indicate that including the yCHNt shock reduces the impact from p�t under both regimes; and the marginal impact from i�t is identi�ed better. This result suggests that omitting shocks from China results in an incorrect speci�cation of the VAR model. Moreover, we �nd that the e¤ects of yCHNt shocks on yPERt are expansionary and last more than two years. The elasticity of the yCHNt shock under both regimes is around 0.8%. We also �nd that i�t shocks are contractionary, with an elasticity of 0.3%; and that the responses of yPERt to a 10% p�t shock are 0.1% and 0.5% under regimes 1 and 2, respectively. The FEVD results in column 3 of Figure 18 suggest that external shocks explain 70% of yPERt variability under regime 2 and 35% under regime 1. By including yCHNt we evidence that the FEVD for this model is similar to that for the baseline model. That is, the yCHNt shocks explain 32% of yPERt variability under the pre-IT regime; and yCHNt , p�t , and i � t explain 37%, 30%, and 33%, respectively, of the forecast error variance under the post-IT regime. Therefore, by adding yCHNt , the model re�ects better the stylized facts of Peru�s economy. When yCHNt is included, the HD results for yPERt (row 3, Figure 19) indicate that real demand shocks were the main factor in explaining the increase in yPERt under regime 2. Speci�cally, the yCHNt shock contributed 0.8 p.p. (around 76%) to this increase. Additionally, the contribution of domestic shocks decreases relative to previous models; e.g., the MP shock contributed 0.3 p.p. (around 29%) to the increase, further evidencing the importance of considering yCHNt shocks to ensure an appropriate speci�cation for the VAR model. In addition, the IRF, FEVD and HD of the CVAR model are similar to those of the baseline model. 5.7 Eight-Variable Model (with Fiscal Policy) The last robustness exercise adds a �scal policy channel within the domestic variable block. For this purpose, we use public investment growth (gpubt ). Therefore, the model is formed by eight variables: (i) the external block (yUSAt , yCHNt , i�t , and p � t ) and (ii) the domestic block (g pub t , yPERt , �PERt , and iPERt ). We underscore that we chose capital over current expenditure as �scal policy instrument, as it is the main driver of Peru�s output growth according to Jiménez and Rodríguez (2020). Additionally, like in previous exercises, the BF largely favors the RS-VAR-SV-R1 model with two regimes relative to the other models (Table 3). In particular, the BFs between the RS- VAR-SV-R1 with two regimes (r = 2) and the CVAR and RS-VAR-SV models with two regimes (r = 2) are 6.3�1066 and 3.2�1060, respectively. The IRFs for yPERt in row 5 of Figures 16 (regime 1) and 17 (regime 2) show that the yUSAt , yCHNt , and p�t shocks are expansionary under both regimes, while i � t shocks are contractionary. Additionally, the magnitudes of the responses are similar to those in the seven-variable model for both regimes. Regarding the gpubt shock, we verify that the response of yPERt is expansionary and dissipates after one year. It should be noted that the evolution of the IRFs across regimes suggests that the impact increased under the post-IT regime; i.e., currently an increase in public investment has a higher return than under the pre-IT regime. Speci�cally, the responses of yPERt to a 1% gpubt 18 shock are 0.2% and 0.3% under regimes 1 and 2, respectively, in line with Jiménez and Rodríguez (2020). The FEVD results (column 5, Figure 18) indicate that, by including gpubt shocks, the contri- bution of external shocks to yPERt variability diminishes under regimes 1 and 2 (25% and 38%, respectively). Therefore, our results are in line with the studies by Mendoza and Collantes Goic- ochea (2017), Jiménez and Rodríguez (2020), and Rodríguez and Vassallo (2022), where inclusion of gpubt shocks considerably reduces the uncertainty from external shocks. Particularly, the gpubt shock explains around 35% and 60% of yPERt �uctuations under regimes 1 and 2, respectively, as capi- tal expenditure is a discretionary MEF decision and gpubt budget implementation by sub-national governments is largely unpredictable (around 50% according to Jiménez et al. (2020)). Based on the HD results for yPERt in row 5 of Figure 19, we calculate that, out of the 1.1-p.p. increase in yPERt between regimes 1 and 2, the gpubt shock contributed 0.2 p.p. (around 16%), con�rming the role of public investment as a major output growth bu¤er. Furthermore, the higher contribution under regime 2 is associated with the decentralization of capital expenditure, whereby sub-national governments can use a higher portion of mining canon revenues to �nance more public works, according to Santa María et al. (2009). For its part, the MP shock contributed 0.3 p.p. (around 23%) to the increase in yPERt under the post-IT regime. These �ndings also con�rm sound MEF and BCRP policy implementation under the post-IT regime; see Jiménez et al. (2020) and Rodríguez and Vassallo (2022). The CVAR model for this broader speci�cation has the same drawbacks as the CVAR baseline model, i.e., IRFs with overestimated or underestimated values. On the part of the FEVD, we �nd that the CVAR only captures the contributions of the second regime, and concerning the HD, it does not capture the role of monetary policy shocks explained in the baseline model. 6 Conclusions This article studies the evolution and e¤ect of external shocks on Peru�s macroeconomic �uctua- tions in 1994Q1-2019Q4. For this purpose, we estimate models with regime change and stochastic volatility (RS-VAR-SV), which are identi�ed recursively. Using four external and three domestic variables, we �nd that the data favor a stochastic volatility model and constant coe¢ cients (RS- VAR-SV-R1) over a conventional VAR (CVAR) model and other restricted RS-VAR-SV models. Importantly, we identify two regimes, which divide the sample into a pre-IT regime (1994-2002) and a post-IT regime (2003-2019). All external shocks have the expected impact on output growth (yPERt ). Speci�cally, the U.S. real demand shock (yUSAt ) has a mixed impact on the response of yPERt ; the China growth shock (yCHNt ) and the commodity price shock (p�t ) have a positive impact on y PER t ; and the Fed interest rate shock (i�t ) has a negative impact. Furthermore, the impact of the y CHN t and p�t shocks on y PER t is greater under regime 2. External shocks explain 35% and 70% of yPERt variability under regimes 1 and 2, respectively. Higher uncertainty under regime 1 is associated with yCHNt and yUSAt shocks, while yCHNt and p�t shocks are the main source of y PER t uncertainty under regime 2. Additionally we verify a moderation in monetary policy after IT adoption. Historical decomposition shows that the main driver of the increase in yPERt under regime 2 was the yCHNt shock, which explained around 89% of the increase. Additionally, our analysis of the Global Financial Crisis and the U.S.-China trade wars indicates that external real demand shocks had a negative impact on yPERt , while monetary policy shocks were important in o¤setting the 19 negative e¤ect of these events. Based on the estimation of alternative speci�cations (robustness exercises), we �nd that omitting China growth shocks alters the magnitude and signi�cance of commodity price shocks. Moreover, including �scal policy via public investment growth into the model does not modify the responses to external shocks, but reduces uncertainty from external shocks on output growth. The �ndings in this article highlight the challenges from an evolving international environment for a small, open, commodity-exporting economy like Peru. In the face of external shock volatility, a main challenge for policymakers is implementing counter-cyclical policy tools to reduce its e¤ects on macroeconomic stability. Additionally, the high contribution of commodity prices in output growth variability underscores the need for product diversi�cation as a mechanism for reducing medium- and long-term growth uncertainty. Finally, MEF and BCRP policies, like IT adoption and �scal discipline, must be preserved to secure an optimal response to shocks, as under regime 2. References [1] Ahmed, S. (2003). Sources of economic �uctuations in Latin America and implications for choice of exchange rate regimes. Journal of Development Economics, 72(1), 181-202. doi: 10.1016/S0304-3878(03)00073-7 [2] Bianchi, F., and L. Melosi (2017). Escaping the Great Recession. American Economic Review, 107(4), 1030-58. doi: 10.1257/aer.20160186 [3] Bijsterbosch, M., and Falagiarda, M. (2015). The macroeconomic impact of �nancial fragmen- tation in the euro area: Which role for credit supply? Journal of International Money and Finance 54, 93-115. doi: 10.1016/j.jimon�n.2015.02.013 [4] Bing, X., Roth, M., and Santabárbara, D. (2019). Global Impact of a Slowdown in China. Economic Bulletin 1, 1-11. [5] Broda, C. M., and Tille, C. (2003). Coping with Terms-of-trade Shocks in Developing Coun- tries. Current Issues in Economics and Finance 9(11), 1-7. [6] Calvo, G., Leiderman, L., and Reinhart, C. (1993). Capital In�ows and Real Exchange Rate Appreciation in Latin America: The Role of External Factors. IMF Sta¤ Papers 40(1), 108- 151. doi: 10.2307/3867379 [7] Campos, L. (2015). An analysis of exogenous shocks using structural vector autoregressions identi�ed with sign restrictions. Ph.D. Thesis, Universidad Complutense de Madrid. [8] Canova, F. (2005). The transmission of US shocks to Latin America. Journal of Applied Econo- metrics 20(2), 229-251. doi: 10.1002/jae.837 [9] Castillo, P., Montoya, J., and Quineche, R. (2016). From the �Great In�ation�to the �Great Moderation� in Peru: A Time Varying Structural Vector Autoregressions Analysis. BCRP Working Papers, 003. [10] Castillo, P., and Pereda, J. (2009). Lecciones de la crisis rusa para enfrentar la crisis �nanciera global mundial. Revista Moneda 139, 43-48. 20 https://www.sciencedirect.com/science/article/abs/pii/S0304387803000737?via%3Dihub https://www.aeaweb.org/articles?id=10.1257/aer.20160186 https://www.sciencedirect.com/science/article/abs/pii/S0261560615000285?via%3Dihub https://www.jstor.org/stable/3867379 https://onlinelibrary.wiley.com/doi/10.1002/jae.837 [11] Castillo, P., and Salas, J. (2010). Los Términos de Intercambio como Impulsores de Fluc- tuaciones Económicas en Economías en Desarrollo: Estudio Empírico (Vol. 78). Centro de Estudios Monetarios Latinoamericanos, CEMLA. [12] Cesa-Bianchi, A., Pesaran, M. H., Rebucci, A., and Xu, T. (2013). China�s Emergence in the World Economy and Business Cycles in Latin America. In The GVAR Handbook (p. 195-211). Oxford University Press. doi: 10.1093/acprof:oso/9780199670086.003.0013 [13] Chan, J. C. C., and E. Eisenstat (2015). Marginal Likelihood Estimation with the Cross- entropy Method. Econometric Reviews 34(3), 256-285. doi: 10.1080/07474938.2014.944474 [14] Chan, J. C. C., and E. Eisenstat (2018). Bayesian Model Comparison for Time-Varying Para- meter VARs with Stochastic Volatility. Journal of Applied Econometrics 33(4), 509-532. doi: 10.1002/jae.2617 [15] Charnavoki, V., and Dolado, J. J. (2014). The E¤ects of Global Shocks on Small Commodity- Exporting Economies: Lessons from Canada. American Economic Journal: Macroeconomics, 6(2), 207-237. doi: 10.1257/mac.6.2.207 [16] Chib, S. (1996). Calculating Posterior Distribution and Model Estimates in Markov Mixture Models. Journal of Econometrics 75(1), 79-97. doi: 10.1080/01621459.1995.10476635 [17] Chinn, M. D., and Ito, H. (2008). A New Measure of Financial Openness. Journal of Compar- ative Policy Analysis 10(3), 309-322. doi: 10.1080/13876980802231123 [18] Cogley, T., and Sargent, T. J. (2005). Drifts and volatilities: monetary policies and outcomes in the post WWII US. Review of Economic Dynamics 8(2), 262-302. doi: 10.1016/j.red.2004.10.009 [19] Dancourt, O., Mendoza, W., and Vilcapoma, L. (1997). Fluctuaciones Económicas y Shocks Externos, Perú 1950-1996. Economía 20(39-40), 63-102. [20] Drechsel, T., and Tenreyro, S. (2018). Commodity Booms and Busts in Emerging Economies. Journal of International Economics 112, 200-2018. doi: 10.1016/j.jinteco.2017.12.009 [21] Droumaguet, M. (2012). Markov-Switching Vector Autoregressive Models: Monte Carlo ex- periment, impulse response analysis, and Granger-Causal analysis. Phd. Thesis, European University Institute. doi: 10.2870/63610 [22] Dungey, M., Fry-Mckibbin, R., and Volkov, V. (2020). Transmission of a Resource Boom: The Case of Australia. Oxford Bulletin of Economics and Statistics 82 (3), 503-525. doi : 10.1111/obes.12352 [23] Dées, S., di Mauro, F., Pesaran, M. H., and Smith, L. V. (2007). Exploring the international linkages of the euro area: a global VAR analysis. Journal of Applied Econometrics 22(1), 1-38. doi: 10.1002/jae.932 [24] Fernández, A., González, A., and Rodríguez, D. (2018). Sharing a ride on the commodities roller coaster: Common factors in business cycles of emerging economies. Journal of Interna- tional Economics 111(C), 99-121. doi: 10.1016/j.jinteco.2017.11.008 21 https://oxford.universitypressscholarship.com/view/10.1093/acprof:oso/9780199670086.001.0001/acprof-9780199670086-chapter-13 https://www.tandfonline.com/doi/abs/10.1080/07474938.2014.944474 https://onlinelibrary.wiley.com/doi/10.1002/jae.2617 https://www.aeaweb.org/articles?id=10.1257/mac.6.2.207 https://www.tandfonline.com/doi/abs/10.1080/01621459.1995.10476635 https://www.tandfonline.com/doi/abs/10.1080/13876980802231123 https://www.sciencedirect.com/science/article/abs/pii/S1094202505000049?via%3Dihub https://www.sciencedirect.com/science/article/pii/S0022199617301630?via%3Dihub https://cadmus.eui.eu//handle/1814/25135 https://onlinelibrary.wiley.com/doi/10.1111/obes.12352 https://onlinelibrary.wiley.com/doi/10.1002/jae.932 https://www.sciencedirect.com/science/article/abs/pii/S0022199617301423?via%3Dihub [25] Fernández, A., Schmitt-Grohé, S., and Uribe, M. (2017). World shocks, world prices, and business cycles: An empirical investigation. Journal of International Economics 108(S1), S2-S14. doi: 10.1016/j.jinteco.2017.01.001 [26] Fernández, A., Schmitt-Grohé, S., y Uribe, M. (2020). Does the Commodity Super Cycle Matter? NBER Working Papers 27589. [27] Flores J. (2016). Transmisión de choques de política monetaria de Estados Unidos sobre América Latina: Un enfoque GVAR. Revista Estudios Económicos 32, 35-54. [28] Florián, D., Aguilar, J., Toma, H., and Velásquez, C. (2018). Impacto de los cambios antici- pados de los términos de intercambio en la economía. Revista Moneda 174, 21-25. [29] Frankel, J. A. (2014). E¤ects of speculation and interest rates in a �carry trade� model of commodity prices. Journal of International Money and Finance, 42, 88-112. doi: https://doi.org/10.1016/j.jimon�n.2013.08.006 [30] Gómez, V., and Maravall, A. (1996). Programs TRAMO and SEATS, Instruction for User (BetaVersion: september 1996). Working Papers 9628, Banco de España. [31] Gruss, B. (2014). After the Boom�Commodity Prices and Economic Growth in Latin America and the Caribbean. IMF Working Papers, 14(154). doi: 10.5089/9781498363518.001 [32] Gruss, B., and Kebhaj, S. (2019). Commodity Terms of Trade: A New Database. IMF Working Papers, 19(21). doi: 10.5089/9781484393857.001 [33] Guevara, B., Rodríguez, G., and Yamuca, L. (2022). External Shocks and Macroeconomic Fluctuations in Peru: Time-Varying E¤ects Using a Mixture Innovation TVP-VAR-SV Model. Manuscript, Department of Economics, Ponti�cia Universidad Católica del Perú. [34] Han, F. (2014). Measuring External Risks for Peru: Insights from a Macroeconomic Model for a Small Open and Partially Dollarized Economy. IMF Working Papers, 14(161). doi: 10.5089/9781498327220.001 [35] Ho¤maister, A. W., and Roldos, J. (1997). Are Business Cycles Di¤erent in Asia and Latin America? IMF Working Papers, 97(9). doi: 10.5089/9781451927313.001 [36] Ho¤maister, A. W., Roldos, J. E., and Wickham, P. (1997). Macroeconomic Fluctuations in Sub-Saharan Africa. IMF Working Papers, 97(82). doi: 10.5089/9781451954746.001 [37] IMF. (2014). Peru: Sta¤ Report for the 2013 Article IV Consultation. IMF Sta¤ Country Reports, 14(21). doi: 10.5089/9781484394564.002 [38] IMF. (2015). Peru: 2015 Article IV Consultation-Press Release; Sta¤ Report; and State- ment by the Executive Director for Peru. IMF Sta¤ Country Reports, 15(133). doi: 10.5089/9781513539317.002 [39] IMF. (2019). Spillovers to Latin America from Growth Slowdowns in China and the United States. En Regional Economic Outlook, October 2019, Western Hemisphere Department. doi: 10.5089/9781513513959.086 22 https://www.sciencedirect.com/science/article/pii/S002219961730003X?via%3Dihub https://www.sciencedirect.com/science/article/abs/pii/S0261560613001083?via%3Dihub https://www.elibrary.imf.org/view/journals/001/2014/154/001.2014.issue-154-en.xml https://www.elibrary.imf.org/view/journals/001/2014/154/001.2014.issue-154-en.xml https://www.elibrary.imf.org/view/journals/001/2014/161/001.2014.issue-161-en.xml https://www.elibrary.imf.org/view/journals/001/1997/009/001.1997.issue-009-en.xml https://www.elibrary.imf.org/view/journals/001/1997/082/001.1997.issue-082-en.xml https://www.elibrary.imf.org/view/journals/002/2014/021/002.2014.issue-021-en.xml https://www.elibrary.imf.org/view/journals/002/2015/133/002.2015.issue-133-en.xml https://www.elibrary.imf.org/view/books/086/28355-9781513513959-en/28355-9781513513959-en-book.xml [40] IMF. (2020). Peru : 2019 Article IV Consultation-Press Release; Sta¤Report; Sta¤ Statement and Statement by the Executive Director for Peru. IMF Sta¤ Country Reports, 20(3). doi: 10.5089/9781513526119.002 [41] Izquierdo, A., Romero-Aguilar, R., and Talvi, E. (2008). Booms and Busts in Latin America: The Role of External Factors. SSRN Electronic Journal. doi: 10.2139/ssrn.1820920 [42] Jiménez, A., Merino, C., and Sosa, J. C. (2020). Local Public Investment Drivers in Peru. Economía, 43(86), 57-78. doi: 10.18800/economia.202002.003 [43] Jiménez, A., and Rodríguez, G. (2020). Time-Varying Impact of Fiscal Shocks over GDP Growth in Peru: An Empirical Application using Hybrid TVP-VAR-SV Models. Working Paper, 489, Department of Economics, Ponti�cia Universidad Católica del Perú. [44] Kim, C.-J. and C. R. Nelson (1999). State-Space Models with Regime Switching. MIT Press, London, England and Cambridge, Massachusetts. doi: 10.7551/mitpress/6444.001.0001 [45] Kose, M. A. (2002). Explaining business cycles in small open economies. Journal of Interna- tional Economics, 56(2), 299-327. doi: 10.1016/S0022-1996(01)00120-9 [46] Kose, M. A., Lakatos, C., Ohnsorge, F., and Stocker, M. (2017). The Global Role of the U.S. Economy: Linkages, Policies and Spillovers. The World Bank Policy Research Working Paper, 7962. doi: 10.1596/1813-9450-7962 [47] Krolzig, H. M. (1997).Markov-Switching Vector Autoregressions (Vol. 454). Berlin, Heidelberg. doi: 10.1007/978-3-642-51684-9 [48] Lane, P. R., and Milesi-Ferretti, G. M. (2007). The external wealth of nations mark II: Revised and extended estimates of foreign assets and liabilities, 1970-2004. Journal of International Economics, 73(2), 223-250. doi: 10.1016/j.jinteco.2007.02.003 [49] Lanne, M., Lütkepohl, H., and Maciejowska, K. (2010). Structural vector autoregressions with Markov switching. Journal of Economic Dynamics and Control, 34(2), 121-131. doi: 10.1016/j.jedc.2009.08.002 [50] Lanteri, L. (2008). Choques de precios de materias primas, desempeño �scal y crecimiento. Una propuesta de VAR estructural para la economía Argentina. Estudios Económicos, 23(2), 163-202. [51] Lubik, T. and W. L. Teo (2005), �Do World Shocks Drive Domestic Business Cycles? Some Evidence from Structural Estimation�, Economics Working Paper Archive 522, The Johns Hopkins University, Department of Economics. [52] Mendoza, E. G. (1995). The Terms of Trade, the Real Exchange Rate, and Economic Fluctu- ations. International Economic Review, 36(1), 101-107. doi: 10.2307/2527429 [53] Mendoza, W. (2013). Milagro peruano: ¿buena suerte o buenas políticas? Economía, 36(72), 35-90. doi: 10.13140/rg.2.1.4387.5442 23 https://www.elibrary.imf.org/view/journals/002/2020/003/002.2020.issue-003-en.xml https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1820920 https://revistas.pucp.edu.pe/index.php/economia/article/view/22814 https://doi.org/10.7551/mitpress/6444.001.0001 https://www.sciencedirect.com/science/article/abs/pii/S0022199601001209?via%3Dihub http://mr.crossref.org/iPage?doi=10.1596%2F1813-9450-7962 https://link.springer.com/book/10.1007%2F978-3-642-51684-9 https://www.sciencedirect.com/science/article/abs/pii/S0022199607000591?via%3Dihub https://www.sciencedirect.com/science/article/abs/pii/S0165188909001481?via%3Dihub https://www.jstor.org/stable/2527429?origin=crossref https://www.researchgate.net/publication/303676008_El_milagro_peruano_Buena_suerte_o_buenas_politicas?channel=doi&linkId=574c727e08ae061b32ff7344&showFulltext=true [54] Mendoza, W., and Collantes Goicochea, E. (2017). La economía de PPK. Promesas y resul- tados: la distancia que los separa. Working Paper, 440, Ponti�cia Universidad Católica del Perú. [55] Nolazco, J., Lengua Lafosse, P., and Céspedes, N. (2016). Contribución de los choques externos en el crecimiento económico del Perú : un modelo semi-estructural. BCRP Working Papers, 006. [56] Ojeda Cunya, J. A., and Rodríguez, G. (2022). Time-Varying E¤ects of Foreign Shocks on Macroeconomic Fluctuations in Peru: Empirical Application using TVP-VAR-SV Models. Manuscript, Department of Economics, Ponti�cia Universidad Católica del Perú. [57] Pedersen, M. (2019). The impact of commodity price shocks in a copper-rich economy: the case of Chile. Empirical Economics, 57(4), 1291-1318. doi: 10.1007/s00181-018-1485-9 [58] Pesaran, M. H. H., Schuermann, T., and Weiner, S. M. (2004). Modeling Regional Interdepen- dencies Using a Global Vector Error-Correcting Macroeconometric Model. Journal of Business and Economic Statistics, 22(2), 129-162. doi: 10.2139/ssrn.293714 [59] Portilla, J., Rodríguez, G., and Castillo B., P. (2022). Evolution of Monetary Policy in Peru: An Empirical Application Using a Mixture Innovation TVP-VAR-SV Model. Forthcoming in CESifo Economic Studies. [60] Primiceri, G. E. (2005). Time Varying Structural Vector Autoregressions and Monetary Policy. The Review of Economic Studies, 72(3), 821-852. [61] Roache, S. K. (2012). China�s Impacton World Commodity Markets. IMF Working Papers, 12(115). doi: 10.5089/9781475503364.001 [62] Rodríguez, G., and Vassallo, R. (2022). Time Evolution of Foreign Shocks on Macroeconomic Fluctuations in Paci¢ c Alliance Countries: Empirical Application using a Set of TVPVAR-SV Models. Manuscript, Department of Economics, Ponti�cia Universidad Católica del Perú. [63] Rodríguez, G., Villanueva Vega, P., and Castillo Bardalez, P. (2018). Driving economic �uc- tuations in Peru: the role of the terms of trade. Empirical Economics, 55(3), 1089-1119. doi: 10.1007/s00181-017-1318-2 [64] Rubio-Ramirez, J. F., Waggoner, D. F., and Zha, T. A. (2005). Markov-Switching Structural Vector Autoregressions: Theory and Application. FRB of Atlanta Working Paper, 27. doi: 10.2139/ssrn.870478 [65] Santa María, H., Saavedra, J., and Burga, L. (2009). Historia Fiscal en el Perú 1980-2009. Cuadernos Tributarios, IFA-Perú, 29, 125-194. [66] Schmitt-Grohé, S., and Uribe, M. (2018). How Important are Terms-of-Trade Shocks? Inter- national Economic Review, 59(1), 85-111. doi: 10.1111/iere.12263 [67] Shousa, S. (2016). Macroeconomic E¤ects of Commodity Booms and Busts: The Role of Financial Frictions. Manuscript. 24 https://link.springer.com/article/10.1007%2Fs00181-018-1485-9 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=293714 https://www.elibrary.imf.org/view/journals/001/2012/115/001.2012.issue-115-en.xml https://link.springer.com/article/10.1007%2Fs00181-017-1318-2 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=870478 https://onlinelibrary.wiley.com/doi/10.1111/iere.12263 [68] Sims, C. A. (1980). Macroeconomics and Reality. Econometrica, 48(1), 1-48. doi: 10.2307/1912017 [69] Sims, C. A., Waggoner, D. F., and Zha, T. (2008). Methods for inference in large mul- tipleequation Markov-switching models. Journal of Econometrics, 146(2), 255-274. doi: 10.1016/j.jeconom.2008.08.023 [70] Sims, C. A., and Zha, T. (2006). Were There Regime Switches in U.S. Monetary Policy? American Economic Review, 96(1), 54-81. doi: 10.1257/000282806776157678 [71] Wong, B. (2017). Historical Decompositions for Nonlinear Vector Autoregression Models. SSRN Electronic Journal. doi: 10.2139/ssrn.3057759 [72] World Bank. (2019). Trade integration as a pathway to development? The World Bank. doi: 10.1596/978-1-4648-1516-4 [73] Wu, J. C., and Xia, F. D. (2016). Measuring the Macroeconomic Impact of Monetary Policy at the Zero Lower Bound. Journal of Money, Credit and Banking, 48(2-3), 253-291. doi: 10.1111/jmcb.12300. 25 https://www.jstor.org/stable/1912017?origin=crossref https://www.sciencedirect.com/science/article/abs/pii/S0304407608001140?via%3Dihub https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3057759 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3057759 http://mr.crossref.org/iPage?doi=10.1596%2F978-1-4648-1516-4 https://onlinelibrary.wiley.com/doi/10.1111/jmcb.12300 T ab le 1. T es ts fo r T im e V ar ia ti on in C oe ¢ ci en ts an d V ol at ili ty T ra ce T es t T ra ce 16 % p er c. 50 % p er c. 84 % p er c. 0. 28 0. 21 0. 30 0. 40 T es t M at ri x Sa m pl e C oe ¢ ci en ts 19 93 Q 2- 20 19 Q 4 19 93 Q 2- 20 19 Q 4 19 93 Q 2- 20 06 Q 2 B 0 t 15 /2 1 16 /2 1 16 /2 1 K ol m og or ov -S m ir no v B i t 51 /5 6 48 /5 6 49 /5 6 � t 7/ 7 7/ 7 7/ 7 B 0 t 20 /2 1 19 /2 1 21 /2 1 t- te st B i t 49 /5 6 47 /5 6 43 /5 6 � t 7/ 7 7/ 7 7/ 7 T he T ra ce te st re p or ts th e tr ac e of th e pr io r va ri an ce s m at ri x (� t) . T he se co nd , th ir d an d fo ur th co lu m ns re p or t th e 16 % , 50 % an d 84 % p er ce nt ile s of th e p os te ri or of � t. T he K ol m og or ov -S m ir no v an d t- te st re p or t th e nu m b er of ti m e- va ry in g co e¢ ci en ts in th e m at ri x of co nt em p or an eo us re la ti on sh ip s (B 0 t ), th e m at ri x of in te rc ep t