Swept by the Tide? The International Comovement of Capital Flows

This paper assesses the international comovement of gross capital flows in a setting simultaneously encompassing aggregate inflows and outflows. It uses as empirical framework a multilevel latent factor model, implemented on flow data for a large sample of countries over more than three decades. On average, common shocks account for over 40 percent of the variance of both inflows and outflows, although with major differences between advanced countries and the rest. Among the former, global and group shocks dominate capital flows, and the same shocks drive gross inflows and outflows. Among the latter countries, idiosyncratic shocks tend to play the leading role, and gross inflows exhibit less commonality with outflows. The latent factors configure an international financial cycle that closely tracks the trends in a handful of global "push" variables. Recursive estimation of the factor model reveals a rising trend in the exposure of countries' flows to the international cycle?especially for advanced economies?up to the global financial crisis. Exposure to the cycle is robustly related to countries' external financial openness and the (lack of) flexibility of their exchange rate regime.


Policy Research Working Paper 8787
This paper assesses the international comovement of gross capital flows in a setting simultaneously encompassing aggregate inflows and outflows. It uses as empirical framework a multilevel latent factor model, implemented on flow data for a large sample of countries over more than three decades. On average, common shocks account for over 40 percent of the variance of both inflows and outflows, although with major differences between advanced countries and the rest. Among the former, global and group shocks dominate capital flows, and the same shocks drive gross inflows and outflows. Among the latter countries, idiosyncratic shocks tend to play the leading role, and gross inflows exhibit less commonality with outflows. The latent factors configure an international financial cycle that closely tracks the trends in a handful of global "push" variables. Recursive estimation of the factor model reveals a rising trend in the exposure of countries' flows to the international cycle-especially for advanced economies-up to the global financial crisis. Exposure to the cycle is robustly related to countries' external financial openness and the (lack of ) flexibility of their exchange rate regime. This paper is a product of the Development Research Group, Development Economics. It is part of a larger effort by the World Bank to provide open access to its research and make a contribution to development policy discussions around the world. Policy Research Working Papers are also posted on the Web at http://www.worldbank.org/research. The authors may be contacted at lserven@worldbank.org.

Introduction
In a world of increasingly open capital accounts, cross-border financial flows offer a major channel for the international propagation of financial turbulence. Indeed, the global pattern of capital flows is portrayed in terms of worldwide 'surges', 'waves', and 'tides' overrunning national economies. 1 In this setting, an important question for policy makers concerned with macroeconomic and financial stability is to what extent the capital inflows and outflows of their national economies are driven by global forces beyond their control, and how the answer to that question may be affected by domestic policy choices. These issues are the focus of this paper. It assesses the contribution of common shocks to the observed patterns of gross capital flows across a large sample of countries. The analysis is conducted in the framework of a multilevel factor model encompassing both gross inflows and gross outflows, and allowing for latent factors that affect all flows to all countries, along with latent factors that affect only flows to/from specific groups of countries and/or going in a single direction. Our focus is on the aggregate flows of advanced and emerging countries, but the main conclusions need little change if developing countries are also included in the analysis.
Our results indicate that capital flows exhibit a considerable deal of commonality. Information criteria show that the cross-country dependence of gross inflows and outflows worldwide is adequately captured by a two-level model featuring a single global factor, along with an advancedcountry factor, and a third factor embedded in emerging-country gross inflows -but not outflows. The latter result reflects the fact that, outside advanced countries, gross inflows do not comove closely with gross outflows. 2 On average, common shocks -as captured by the latent factors -account for over 40 percent of the variance of both gross inflows and outflows. There is a marked contrast between advanced and emerging countries, however. Among the former, common shocks contribute 60 percent of the variance of gross flows; among the latter, they contribute just around 1 one-third. These figures show little change if major financial centers are excluded to prevent them from distorting the calculations, due to their disproportionate share in worldwide capital flows. The latent common factors configure an international financial cycle driving capital flows around the world. The cycle is strongly correlated with a handful of variables characterizing world financial and real conditions: market perceptions of risk, the U.S. real exchange rate and the term premium, worldwide financial openness, and world commodity prices. Dynamic regressions of the factors on these variables -most of which have featured prominently in a longstanding "push vs pull" empirical literature on capital flows -account for over 90 percent of the variance of the global factor, and over 80 percent of that of the group factors. Countries' exposure to the international financial cycle -as measured by the portion of the standard deviation of flows attributable to the common factors -is robustly related to two key features of their macrofinancial policy framework: the degree of financial openness, and the flexibility of the exchange rate regime. Increased openness raises exposure, while increased exchange rate flexibility has the opposite effect. The latter result suggests that the choice of exchange rate regime continues to matter for the international propagation of shocks, notwithstanding the global reach of the financial cycle. Our setting also allows us to assess the trends in financial globalization over time, as measured by countries' changing exposure to common shocks driving their capital flows. Recursive estimation of the factor model over 20-year samples reveals a cycle of increasing financial globalization prior to the global financial crisis, and partial reversal in its aftermath. The cycle is especially pronounced among advanced countries. Our paper relates to several strands of literature. First, it adds to a longstanding empirical research concerned with the respective roles of common and country-specific factors for the cross-country patterns of capital inflows. Earlier contributions, going back to Calvo et al. (1996), cast the distinction in terms of 'push' and 'pull' factors. In these papers, common / push factors are represented by a handful of variables capturing financial conditions and risk perceptions in world financial markets (Forbes and Warnock (2012), Bruno and Shin (2015a), Bruno and Shin (2015b), Cerutti et al. (2017b)). More recent contributions feature a latent common factor(s) summarizing the international financial cycle (e.g., Rey (2013), Barrot and Serven (2018)). The quantitative relevance of the latter has been recently challenged by Cerutti et al. (2017c), who argue that the global cycle accounts only for a modest fraction of the variation of capital flows. We extend this literature by analyzing jointly gross inflows and outflows in an encompassing empirical framework. To our knowledge, this is the first paper confronting such task. 3 While most previous literature has been concerned with the cross-country comovement of specific types of flows, we take an aggregate perspective, which is the more relevant one for assessing countries' overall vulnerability to common shocks. We show that this choice matters for assessing the quantitative reach of the international financial cycle, which is understated by a disaggregated analysis. Our setup also allows us to distinguish between exposure to shocks affecting all countries, and to those affecting specific country groups -advanced, emerging or developing -as well as between the responses of gross inflows and gross outflows. Finally, we also clarify how the 'push vs pull' and latent-factor approaches relate to each other, by showing that the common factors embedded in capital flows can be very well explained by a handful of 'push' variables. The paper also speaks to the debate on the determinants of countries' exposure to international financial shocks. The literature has highlighted different ingredients, including capital account openness, financial depth (e.g., Bruno and Shin (2015b)) and, in particular, the role of the exchange rate regime. 4 In theory, the extent to which external shocks ultimately result in actual changes in capital flows should depend on how much of the pressure is absorbed by exchange rate and interest rate changes (e.g., Goldberg and Krogstrup (2018)). Thus, capital flows should respond less to global factors under floating regimes than under pegged regimes. However, in influential contributions, Rey (2013) and Miranda-Agrippino and  argue that, with the trend towards more open capital accounts, the choice of exchange rate regime has ceased to matter for countries' exposure to the global financial cycle. This view is consistent with evidence reported by Passari and Rey (2015) and Cerutti et al. (2017c), who find no robust effect of the exchange rate regime on the sensitivity of credit and capital flows, respectively, to external variables summarizing the global financial cycle. In contrast, Obstfeld et al. (2018) find that, among emerging markets, credit is less sensitive to the global cycle under more flexible regimes. We add to this literature by analyzing how the exposure of aggregate capital inflows and outflows to common shocks is affected by the degree of financial openness and the choice of exchange rate regime, as well as by other key aspects of countries' policy and structural framework. Departing from earlier literature, we use a natural measure of exposure derived from estimation of the factor model, namely the standard deviation of capital flows attributable to the common factors, which summarizes the ability of common shocks to account for the observed variation of crossborder flows. The paper also relates to a literature concerned with the trends in financial globalization following the global financial crisis. The sharp and persistent decline of international capital flows in its aftermath has been interpreted by some observers as proof of financial 'deglobalization', reflected in particular in a generalized contraction of cross-border bank lending in response to regulatory and other policy changes (Forbes (2014), Rose and Wieladek (2014), Van Rijckeghem and Weder di Mauro (2014), Forbes et al. (2017)). However, other papers argue that such view is not supported by more appropriate measures of banking globalization, such as the interconnectedness of the banking network (Cerutti and Zhou (2017)), or nationality-based (as opposed to location-based) measures of cross-border banking activity (McCauley et al. (2017)). Our factor model framework allows us to shed light on this debate, as the aforementioned exposure of cross-border flows to common shocks provides a natural measure of the overall degree of financial globalization. Finally, from the methodological perspective, a few papers have applied latent factor models to cross-border financial flows, usually focusing on particular types of gross inflows and/or outflows -e.g., Byrne and Fiess (2016), Sarno et al. (2016), Cerutti et al. (2017a), Cerutti et al. (2017c), Mandalinci and Mumtaz (2019) -and employing Bayesian estimation techniques. 5 We extend this literature in two directions. First, we model both gross inflows and outflows simultaneously in a multilevel factor model, whose precise structure is determined by the data. Second, we estimate the model using a recently-developed extension of the standard principal components approach that is computationally much simpler than the Bayesian approach of most earlier work, and also avoids imposing unnecessary restrictions on the factors. The rest of the paper is organized as follows. Section 2 lays out the multilevel factor model that provides the analytical framework, and describes the paper's approach to estimation and model selection. Section 3 describes the data, and section 4 reports the empirical results. Section 5 concludes. Appendix A contains additional tables and figures. Appendix B summarizes the empirical results obtained using an enlarged country sample including developing countries. Lastly, Appendix C compares our results regarding the quantitative role of common shocks with those reported by Cerutti et al. (2017c).

Methodological framework
In principle, the observed patterns of gross capital flows around the world may reflect a variety of common shocks. At one end, some common shocks might affect both inflows and outflows to / from all countries. At the other end, other shocks might influence only inflows or only outflows to a particular group of countries. Intermediate combinations are also possible -e.g., shocks that affect all countries' inflows or outflows (but not both), or shocks that affect both inflows and outflows of a particular set of countries (but not all). To identify the respective roles of each of these different kinds of common shocks, as well as that of idiosyncratic shocks, our starting point is the four-level latent factor model: where y denotes gross capital inflow or outflow, m = 1, . . . , M refers to the country group, i = 1, . . . , N m to the i-th country within the m-th group, d ∈ {−1, 1} to the flow direction (inflow or outflow), and t = 1, . . . , T to time. G t denotes a r G ×1 vector of (unobserved) global factors, F R m,t denotes a r R m ×1 vector of factors of group (or region) m (affecting both inflows and outflows), F D d,t denotes a r  (1) can be re-written as: and we can define the following matrices of factors: . By horizontally stacking factors other than the global ones into a T × matrix F (similarly for loadings into Λ), and arranging Y as a T ×2N (with N = M m=1 N m ) matrix, we can arrive to the more compact notation: d∈{−1,1} r RD m,d . As written, this is a static factor model, with factors affecting the dependent variable only contemporaneously. However, it can be reinterpreted as a dynamic factor model with lagged effects of the factors, by expressing their lags as additional static factors (within the same level of the model). As is typical in factor models, the factors and loadings in (3) are not separately identified -e.g., for any non-singular r G × r G matrix M, G, Γ are observationally equivalent toG ≡ GM ,Γ ≡ ΓM −1 . To overcome this issue, we impose the following normalization: This still leaves one free sign for each factorloadings set, which we normalize imposing that the mean (over countries) of the loadings of each factor be non negative. Importantly, there is no need to impose orthogonality between the group factors of different groups within a given level, in contrast with what is often done in Bayesian analyses of multilevel factor models. 6 Such restric-6 It is important to note that correlation between the group factors of different groups 6 tion, which leads to an overidentified model, may or may not hold in the data. Relative to conventional factor models, estimation of the multilevel model (3) poses two challenges. The first one is the fact that the matrix of group factor loadings Λ contains zero restrictions. This prevents a standard principalcomponents estimation approach. Most previous literature has resorted instead to Bayesian estimation techniques (e.g., Kose et al. (2003)). However, suitable extensions of the principal component approach to the multilevel setting have been recently developed by Breitung and Eickmeier (2016) and . Compared with Bayesian estimation, these methods are computationally much simpler, as they just involve a sequence of iterated OLS regressions over the (preliminary) factors to obtain the (preliminary) loadings, and then over the (preliminary) loadings to obtain the (next-iteration) factors. The sequence is repeated until convergence. The sequential OLS procedure allows us to easily implement the zero restrictions on the loadings implied by the multilevel structure. This approach is equivalent to an EM algorithm using a Gaussian pseudo-likelihood. The objective is to minimize the sum of squared residuals with respect to G, F, Γ and Λ, subject to the identifying restrictions listed above. The second challenge arises from the fact that the idiosyncratic error terms u i,m,d,t may show heteroskedasticity, and (weak) cross-sectional and/or time-series correlation. While the principal component estimator remains consistent under such conditions, more efficient estimates may be available. In our case, contemporaneous within-country correlation of the errors is especially likely to be an issue, because the inflows and outflows of a given at a given level is not equivalent to the presence of a higher-level factor common to those groups. Consider for example a two-level model with global and group-specific factors and two country groups of size N 1 and N 2 . Nonzero correlation between a factor of the first group and a factor of the second group does not amount to a global factor common to both groups. While the two correlated factors can always be expressed as a global factor common to both groups plus a group factor specific to one of the groups (say group 1), such reparameterization would involve 2N 1 + N 2 loadings, rather than just N 1 + N 2 , thus using up additional degrees of freedom. country should be subject to similar idiosyncratic shocks. Indeed, preliminary experiments showed that the estimated residuals of inflows and outflows exhibited substantial contemporaneous within-country correlation. Thus, for our empirical exercises we implement the feasible generalized principal components estimator (FGPCE) of Choi (2012), adapted to the multilevel setting. It is obtained from minimization of where we use a consistent estimateΩ of the residual covariance matrix, obtained from a first-round estimation of the model. Since within-country inflow-outflow correlation and heteroskedasticity are the main concerns here, 7 we assume that the only non-diagonal entries of Ω correspond to the covariance between same-country inflows and outflows, and therefore we constructΩ as: whereû m,i,d,t denotes the residuals from first-round estimation. 8 The number of factors of each group at each level is not known a priori, and to determine it we use information criteria. In particular, we use the IC p2 criterion of Bai and Ng (2002), and the Hannan-Quinn (HQ) criterion as adapted to factor models by Choi and Jeong (2018) 9 . In both cases we adapt the criteria to the multilevel case. This requires appropriately modifying the penalty for the number of parameters, which can 7 As discussed below, the residuals showed only very modest time-series and crosscountry correlation. 8 One might wonder if iteration overΩ would deliver additional efficiency gains. A residual bootstrap-based analysis using data with properties similar to those of our sample showed that, beyond the first iteration, further iterations re-estimatingΩ based on the newly-obtained residuals did not yield any efficiency improvement. 9 A residual bootstrap-based analysis showed that these criteria were the ones with best performance in multilevel factor models in artificial samples with properties similar to ours. Working on a single-level setting, Choi and Jeong (2018) show that HQ 2 and IC p2 are among the better performing criteria (together with eigenvalue-based criteria that do not generalize well to multi-level settings). They also note that different criteria often yield different rankings of alternative models, and recommend the use of multiple criteria for model selection.

be written as
where N is total number of countries (so 2N is the overall cross-sectional dimension of the inflow-outflow data) and N m the number of countries in group m. This yields the expressions: with andû i,t is the estimated residual from the factor model with r G global factors and r R m , r D d , r RD m,d group, direction, and group-direction factors. The parameter c in the HQ criterion was set to 2, based on the criterion's performance in residual bootstrap-based experiments.

Data
We assemble a balanced panel data set on annual gross inflows and outflows, drawing from the International Monetary Fund's Balance of Payments Statistics (BoP). The panel comprises 85 countries 10 and spans the years 1979-2015. We further group the sample countries into three categories: 19 advanced countries, 28 emerging countries, and 38 developing countries, as shown in Table A.1.
Gross capital flows are measured by the flows of assets and liabilities of the reporting country's residents vis-a-vis non-residents. Thus, gross inflows are given by the sum of direct investment into the country, plus portfolio investment and other investment liabilities. Gross outflows equal the sum of direct investment abroad, portfolio investment assets, other investment assets, and reserve assets. 11 Figure 1 shows that advanced countries account for the bulk of both inflows and outflows. However, the relative role of emerging countries has been on the rise: over the last decade, their flows represented as much as 30 percent of the total of all countries considered. In contrast, developing countries play a minimal role throughout the sample period -taken together, they accounted for less than 2 percent of both inflows and outflows, without any discernible trend in their share. In absolute terms, advanced and emerging-country capital flows show a rising trend over much of the sample -especially among the former countries, whose flows peak at the onset of the global crisis in 2008. Thus, for the empirical analysis we opt for scaling flows by trend GDP, as done by Broner et al. (2013) and Barrot and Serven (2018). 12 Figure 2 provides a first look at the cross-country comovement of gross capital flows, relative to trend GDP. The figure shows histograms of pairwise correlations of inflows or outflows across countries within the same group (top two rows), across countries regardless of group membership (third row), and within-country inflow-outflow correlations (bottom row). Three facts stand out in the figure. First, the distributions are skewed to the right, indicating that flows of different countries and/or in different directions tend to rise and fall together. Second, the distribution of the within-group correlations in the top two rows is particularly skewed to the right in the case of advanced countries, likely reflecting their higher degree of financial integration. This feature is less pronounced among emerging countries and, especially, developing countries. Skewness to the 11 In reality, these concepts are net rather than gross, and can have either sign. Thus, a positive (negative) gross inflow, as just defined, indicates a net increase (decrease) in foreigners' holdings of domestic assets. Likewise, a positive (negative) gross outflow denotes a net increase (decrease) in the holdings of foreign assets by domestic agents. Nevertheless, following convention we refer to these flows as "gross". 12 In our setting, the use of trend GDP rather than actual GDP helps prevent short-term business cycle fluctuations correlated across countries from distorting the estimates of the model's common factors and common components. Trend GDP is constructed applying the Hodrick-Prescott filter with a parameter of 100 to the series of nominal GDP in US dollars. right is also visible, although more moderate, in the cross-group correlations in the third row graphs. Third, the bottom row shows that the within-country correlation of gross inflows and gross outflows varies considerably across country groups. It is generally very high among advanced countries, and quite sizable among emerging countries, but much lower among developing countries. 13

Results
The evidence just summarized shows that gross capital flows exhibit significant cross-sectional dependence, highest among advanced countries and lowest among developing countries. Still, a latent common factor model such as (3) may provide a suitable characterization of the underlying data only if the dependence is strong (or pervasive) -i.e., it reflects common shocks affecting many countries. If dependence is weak instead -e.g., it arises from localized linkages between countries, such as those due to bilateral trade -attempting to capture it through a latent factor model may yield misleading results. 14 In such conditions, other empirical approaches, such as spatial modeling, are likely to be preferable. 15 The exponent of cross-sectional dependence of Bailey et al. (2016b) provides a metric to assess the nature of the dependence found in the data. It can be viewed as a measure of the rate at which factor loadings (fail to) die off as cross-sectional sample size grows. It ranges between zero and one, with a value of 1 indicating the presence of strong dependence. Table A.3 reports the computed values for the different country groups, along with their 95 percent confidence bands. For both advanced and emerging countries, the exponent of cross-sectional dependence exceeds 0.90, and the 95 percent confidence region includes 1. In contrast, for developing countries the exponent is just 0.77, and the 95 percent confidence region does not reach up to 0.90. These results agree with the evidence shown in Figure 2 that developing countries' flows exhibit less commonality than do the flows of the other country groups. Further, Table A.3 also shows that in a sample combining advanced and emerging countries the exponent of cross-sectional dependence equals 0.94, and its 95 percent confidence region includes 1, while in a sample adding also developing countries the point estimate is under 0.89 and the 95 percent confidence band excludes 1. Overall, the evidence clearly supports the view that the flows of advanced and emerging countries exhibit strong cross-sectional dependence. However, this is not the case for the flows of developing countries. This casts doubt on the suitability of a factor model to capture the patterns of capital flows of the latter countries. Given also that they account for just 2 percent of the total inflows and outflows of all the countries in the overall sample, the analysis below will focus primarily on the sample of advanced and emerging countries. We consider an extended sample with developing countries in an appendix.

Model selection
We turn to the selection of the factor model using the two information criteria introduced earlier. In line with the specification of equation (1) for the case of two country groups (i.e., M = 2), we use the notation (r G ; r R 1 , r R 2 ; r D 1 , r D −1 ; r RD 1,1 , r RD 1,−1 , r RD 2,1 , r RD 2,−1 ) to refer to a model with r G global factors; r R 1 and r R 2 factors for advanced and emerging countries, respectively; r D 1 and r D −1 factors for inflows and outflows, respectively; and r RD 1,1 , r RD 1,−1 , r RD 2,1 and r RD 2,−1 factors for advanced-country inflows, advanced-country outflows, emerging-country inflows and emerging-country outflows, respectively. We considered a wide range of model specifications containing from a minimum of zero factors to a maximum of three at the global, country group and flow direction levels, and two at the country group-flow direction level -a total of 82944 specifications. Overall, models with global and group-specific factors achieved higher scores than models with only global factors. However, specific model rankings vary across the two criteria considered. For this reason, we computed a synthetic standardized score by first dividing each score by the maximum score of the corresponding criterion, and then averaging the two standardized scores computed in this way. Thus, the standardized score is given by (IC p2 /IC p2,max + HQ2/HQ2 max )/2, where the max subscript refers to the highest score obtained under each criterion. Table 1 shows that the highest standardized score corresponds to model specification (1; 1,0; 0,0; 0,0,1,0), featuring one global factor, one advancedcountry factor, and one emerging-country inflow factor. This is also the highest-ranked specification according to the IC p2 criterion. 16 It outperforms models with only global factors (shown in the middle block of the table), as well as a variety of more 'symmetric' models that might seem more intuitive at first glance, featuring inflow and outflow factors and/or factors for each country group-flow direction combination (shown in the bottom panel of the table). For example, a model with one global factor plus one factor for each of the two country groups ranked in 6th place, while a model with one global factor plus another factor for each groupflow direction combination ranked in 261st place. Still, several models shown in the top panel of Table 1 exhibit very similar standardized scores. In order to assess how the choice of specific model affects the estimated factors and loadings, Table 2 reports the correlation between the estimated factors and loadings of the top-ranked model in Table 1 and those of the other most highly-ranked models. It is clear that the estimated global and advanced-country factors are virtually the same regardless of the particular model considered -the correlations with the factors of the top-ranked model exceed 0.94 in all cases. For the emerging countries, factor correlations are again very high, with the exception of the model containing no global factors (0; 1,1; 0,0; 0,0,0,0). 17 In turn, the estimated loadings are also very highly correlated across models, again with the only exception of the loadings on the emerging-country inflow factor of model (0; 1,1; 0,0; 0,0,0,0). On the basis of these findings, we conclude that the factor and loading estimates do not depend crucially on the particular model selected among the high-ranked models.

Factor model estimates
The top-ranked model in Table 1, on which we shall focus, features a single global factor, affecting both gross inflows and outflows of all countries, an advanced-country factor affecting the inflows and outflows of countries in that group, and an additional factor affecting the gross inflows (but not the outflows) of emerging countries. This specification echoes that reported by Barrot and Serven (2018). Working with gross inflows and outflows separately, they find in each case a global factor plus an advanced-country and an emerging-country factor. However, their global and advanced-country inflow factors are very highly correlated with the corresponding outflow factors (the correlation coefficient equals 0.95 for the global factors and 0.82 for the advancedcountry factors). In contrast, the correlation between the inflow and outflow factors is much lower for emerging countries (0.34); moreover, the latter factor (which we fail to identify here) plays a quantitatively marginal role. 18 In a sample comprising all countries in the world, the finding of a single global factor driving both inflows and outflows worldwide would be hardly surprising -every country's inflows must be some other country's outflows. The result holds in our sample even though it excludes many countries -those without complete data from 1979 onward (e.g., all former Soviet Union countries) as well as developing countries -which suggests that their exclusion is of no great consequence for overall cross-border flows. Likewise, the finding of a group factor behind both inflows and outflows of advanced countries is consistent with the fact that the bulk of their flows accrue within the group. This is not the case for emerging markets, consistent with our failure to find a group factor driving both their inflows and outflows. In influential contributions, Rey (2013) and Miranda-Agrippino and Rey (2015) find a global factor behind risky asset prices around the world, which they interpret as evidence of a global financial cycle. Our estimates confirm that a similar result applies to cross-border financial flows. Moreover, our estimates also indicate that, together with a global financial cycle, there are also group-specific cycles affecting particular sets of countries.
In the case of advanced countries, the group cycle drives both inflows and outflows. However, among emerging countries we find evidence of a cycle driving inflows only. 19 This finding is reminiscent of the literature on emerging-market sudden stops, which distinguishes between inflowand outflow-driven stops (Cowan et al. (2008); Rothenberg and Warnock (2011);Calderón and Kubota (2013)), and concludes that inflow-driven sudden stops are more bunched over time than outflow-driven sudden flight. 20 The finding of an inflow-specific factor for emerging-countries is consistent with that evidence. Figure 3 plots the estimated factors, together with 95% confidence bands obtained from a residual block bootstrap 21 . The global factor shows a rising pattern starting in the mid 1990s that becomes sharply steeper in the early 2000s, followed by a collapse at the onset of the global crisis in 2008 and a slight downward trend thereafter. In turn, the advanced-country factor is roughly constant until 1995. It then follows an upward trend until 2000, roughly coinciding with the dot-com bubble. The upward trend resumes subsequently, but gives way to an abrupt fall at the time of the global crisis in 2008, consistent with the post-crisis de-leveraging and unwinding of international positions in advanced economies. Lastly, the emerging-country inflow factor displays large swings around the times of major emerging-market crises -most notably, the 1982 Latin American debt crisis and the 1997-98 East Asian crisis. The confidence bands indicate that the factors are estimated quite precisely. They are fairly persistent -the first-order autocorrelation coefficients are 0.90, 0.73 and 0.78 for the global, advanced and emerging in-flows factor, respectively -but stationary. 22 On the other hand, the two group factors are only weakly correlated -the correlation coefficient is -0.17, with an approximate standard error of 0.16. 23 The sensitivity of each country's gross inflows and outflows to the different common factors is given by their respective factor loadings Γ m,i,d , (1). The estimated loadings are portrayed in Figure 4, with the global factor loadings graphs showing advanced countries first, and summarized in Table 3. Overall, the loadings are estimated somewhat less precisely than the factors. The vast majority of the global factor loadings -33 (of 47) for inflows and 42 for outflows -are positive and significant at the 95% level, and none is significantly negative. The insignificant estimates all belong to emerging markets, with the only exception of New Zealand's. Outflow loadings tend to be larger than inflow loadings. For both gross inflows and outflows, the largest global factor loading corresponds to the Netherlands. Likewise, most of the loadings on the advanced-country factor are positive and significant: 15 (of 19) for gross inflows, and 14 for gross outflows. The insignificant estimates are those of Canada, Australia, Japan and Finland, plus New Zealand in the case of outflows. The largest loadings correspond to the U.K. for both inflows and outflows, possibly reflecting its role as a financial center. Lastly, 15 of 28 loadings on the emerging-country inflow factor are significantly positive, while the other 13 are insignificant. The Philippines and Brazil possess the largest loadings. On the whole, the loadings on both the global and the group factors exhibit considerable variation across countries. Table 3 also shows that they tend to be larger for advanced countries than for emerging countries. The difference is particularly big in the case of gross inflows. Still, some emerging countries do exhibit fairly large loadings -e.g., India in the case of the global factor. In addition, Table 4 shows that the factor loadings of inflows and outflows are positively correlated. Thus, the responsiveness to common shocks of countries' gross inflows comes hand-in-hand with the responsiveness of their gross outflows. This is especially the case among advanced countries: the correlation between their inflow and outflow loadings equals 0.73 for the global factor and 0.88 for the group-specific factor. Among emerging countries, the correlation between the global factor inflow and outflow loadings is much smaller (0.27). However, given the absence of a group factor for the outflows of emerging countries, perhaps a more meaningful statistic is the correlation between the sum of the global and group factor loadings of their inflows, on the one hand, and the global factor loadings of their outflows, on the other. That statistic equals a more respectable 0.47. On the other hand, the loadings on the global and group factors are negatively correlated, which suggests that, to some extent, they play interchangeable roles in capturing countries' exposure to common shocks -although the negative correlation is larger in the case of emerging-country inflows (for which the correlation equals -0.64) than for advanced-country inflows (-0.16) or outflows (-0.34).
Overall, the estimated model does a good job at capturing the comovement of gross capital flows. Figure A.1 in appendix A shows that the estimation residuals appear virtually uncorrelated across countries, while the within-country correlation of inflow and outflow residuals is consderably reduced relative to that in the original data. Further, the model succeeds at removing the strong dependence found in the data, as shown by the exponents of cross-sectional dependence of the residuals reported in Table A.4, which lie well below unity for the full sample as well as the two country groups. 24

How important is the international financial cycle?
The fact that the group and global factors are mutually orthogonal by construction allows a straightforward decomposition of the variance of gross capital flows into the shares attributable to their global, group, and idiosyncratic components. This helps assess the quantitative role of common shocks for the observed patterns of capital flows. Table 5 offers a summary view of the fraction of the variance explained by global and group factors (additional details are given in A.6). On average, the common factors taken together account for a considerable portion of the variance of gross flows -45 percent for gross inflows and 42 percent for gross outflows. However, there is a sharp contrast between advanced and emerging countries. Among the former, common factors account for 58 and 62 percent of the variance of inflows and outflows, respectively. Among the latter, the figures are 36 and 28 percent. Thus, common shocks dominate the capital flows of advanced countries, while idiosyncratic shocks dominate the capital flows of emerging countries. Further, the respective roles of global and group factors are quantitatively similar in the case of gross inflows, while the global factor dominates gross outflows -trivially so in the case of emerging countries, given the absence of a group factor affecting their outflows. One might worry that these results overstate the role of common factors because the advanced-country group includes the world's leading financial centers, which could be artificially inflating the role of commonality. However, the lower panel of Table 5 shows that excluding the U.S., U.K., Switzerland, Germany, and Japan from the calculations has very little effect on the variance decomposition figures. These results concerning the quantitative role of common factors might appear to be in contrast with those that Cerutti et al. (2017c) reach using quarterly data on capital flows disaggregated by flow type (FDI, portfolio debt, portfolio equity, bank credit). They find a very modest role for global factors, whether alone or augmented with a handful of variables summarizing world real and financial conditions. Specifically, regressions of flows on two global factors -one estimated from 6 non-central advanced countries, and another one estimated from 15 emerging market economies (those with weight in the MSCI index above 1%) -yield an average (across countries and flow types) adjusted R 2 of 0.05 (figure A7 of Cerutti et al. (2017c). If the factors are augmented with selected global variables, the adjusted R 2 still averages only 0.12. 25 In Appendix C we show that a large part of the discrepancy with our re-sults disappears when the data used by Cerutti et al. (2017c) are analyzed at the annual frequency and aggregating across flow types. The mean adjusted R 2 increases from 0.05 to 0.22 in their sample of non-large (mainly emerging) countries, and from 0.07 to 0.44 in their sample of advanced countries, with the rest of the discrepancy attributable to differences in country and time sample coverage as well as estimation methodology. If in addition the factors are augmented with global variables, the mean adjusted R 2 rise to 0.45 and 0.61, respectively. Unsurprisingly, aggregation across flows and/or over time smooths out high-frequency flow-specific idiosyncratic shocks, thus raising the relative role of common shocks. Figure 5 depicts the variance contribution of the global and group factors across individual countries, along with the bootstrap-based two-standard error bands of their combined total. There is considerable heterogeneity in the quantitative role of the common factors, even across countries within the same group. Their role is biggest in the Netherlands, where almost 90 percent of the variance of both gross inflows and outflows is driven by common shocks. The same country exhibits the largest variance contribution of global shocks -over 70 percent for both inflows and outflows. The latter figures are very similar to India's, which is the emerging market exhibiting the biggest relative contribution of common shocks. At the other end, New Zealand shows the smallest contribution among advanced economies, while among emerging markets that role corresponds to Pakistan. On the basis of the computed standard errors, common shocks represent a statistically significant force in the vast majority of advanced countries (the only exception is New Zealand in the case of gross outflows, plus Japan and Finland in the case of inflows), but in less than half of the emerging countries shown. Still, the largest emerging economies in the sample -Brazil, India, China -do exhibit significant effects of common shocks, both statistically and quantitatively. The preceding results refer to the fraction of the variance of capital flows attributable to the common factors. From the macroeconomic perspective, however, a more relevant measure of countries' vulnerability to common shocks is the absolute (rather than relative) exposure of their financial flows, expressed as percent of their respective GDP. In this vein, Table 6 shows the standard deviation of gross inflows and outflows explained by the factor model. 26 The cross-country mean and standard deviation of this measure of exposure respectively are 6.02% and 9.45% of trend GDP for inflows, and 6.37% and 9.74% for outflows. Ireland (with a value of almost 60% of trend GDP) is a clear outlier, over 5 standard deviations from the overall mean (6.29 for inflows and 5.82 for outflows). Excluding Ireland, the overall mean and standard deviation fall to 4.86% and 5.15% for inflows, and 5.23% and 5.91% for outflows. Thus, across the sample countries the volume of crossborder flows at the mercy of common shocks amounts on average to some 5% of trend GDP.

Common factors and "push" variables
The above results show that the international financial cycle, as summarized by a set of latent factors, accounts for a good deal of the variation of gross capital inflows and outflows around the world. The latent factor approach has been used by a few recent papers concerned with the global determinants of capital flows, usually focusing on particular types of flows (e.g., Byrne and Fiess (2016) (2019)). However, a longstanding literature, going back to Calvo et al. (1996), takes a different approach. It focuses on the response of capital flows to a handful of "push" variables capturing global real and financial conditions in international markets. Recent literature has stressed in particular risk proxies such as the VIX, as well as global interest rates, the U.S. real exchange rate -owing to the dominant role of the U.S. dollar in financial transactions worldwide -and global commodity prices (e.g., Forbes and Warnock (2012) How do these two approaches relate to each other? To answer this question, we proceed in two steps. First, we examine the association between the estimated common factors and measures of market risk. Recent literature finds that the common factor latent in risky asset prices across the world shows a strong negative correlation with risk proxies (Miranda-Agrippino and Rey (2015), Xu (2017), Abate and Serven (2018), Longstaff et al. (2011)). spread, the Gilchrist and Zakrajsek (2012) corporate bond spread index, and the uncertainty and risk aversion measures constructed by Bekaert et al. (2019). For several of these measures, data availability falls short of our sample coverage. Nevertheless, over the available sample they all exhibit negative correlation with the estimated common factors, significant at the 10 percent level (or higher) in all cases except for the correlation between the BAA spread and the emerging-market inflow factor -probably reflecting the limited ability of such variable at capturing the riskiness of emerging-market assets. 27 Next, we run multivariate regressions of the common factors adding to the risk measure a set of standard "push" variables along the lines mentioned earlier. We also add the degree of openness of capital accounts around the world, which contributes to determine the extent to which shocks should be viewed as common or specific to particular countries or groups; see, e.g., Albuquerque et al. (2005). Table 8 reports the results of estimating a vector autoregression with the common factors as dependent variables, including the forcing variables just listed as exogenous inputs. In reality, they are likely to be jointly determined with the factors, and thus the estimates should be seen as characterizing the correlations in the data rather than identifying causal relationships.
Preliminary exercises using the Schwartz information criterion showed that one single lag of the dependent variables suffices to capture the dynamics. The lagged dependent variable is significant in almost all the regressions, which also exhibit some evidence of lagged cross-factor effects. Inspection of the characteristic roots of the VAR's transition matrix confirms that the system possesses stable dynamics. Columns 1 to 3 of Table 8 report the baseline VAR estimates; columns 4 to 6 present additional estimates using more disaggregated measures of commodity prices. In turn, Figures A.2-A.5 in Appendix A depict the cumulative response of the common factors to a (permanent) one-standard deviation increase in each of the regressors, based on the fitted models in the table.
The BAA spread, taken as risk measure for the regressions owing to its longer sample coverage, follows the same pattern as in the preceding table: its effects are uniformly negative on all three factors, but they are more precisely estimated for the global and advanced-country factors than for the emerging-market inflow factor. In turn, the U.S. real effective exchange rate (defined such that an increase represents a real appreciation) is positively correlated with the global and the advanced-country factors (although for the latter the correlation loses significance over time), but negatively with the emerging-country inflow factor, in line with the arguments of Bruno and Shin (2015a). Next, the measure of worldwide financial openness, which is entered as a three-year moving average to allow for the delayed effects of regulatory changes, has a positive impact on all three factors, particularly large for the global factor. The natural interpretation is that rising capital account openness across the world is a key force behind the upward trend observed in cross-border financial flows.
In contrast, the slope of the U.S. yield curve, given by the difference between long and short interest rates, has a strong negative effect on the group factors, but a more muted (and insignificant) effect on the global factor. 28 Lastly, the non-energy commodity price index shows a positive association with the global and emerging-country inflow factors (although only the former is statistically significant), in line with the analysis of Reinhart et al. (2017). However, it is also significantly negatively associated with the advanced-country factor. This sign pattern is consistent with the fact that emerging economies are more heavily specialized than advanced economies in the production of commodities, and thus a rise in world commodity prices encourages global flows while discouraging those accruing among advanced countries.
Since the non-energy commodity price index combines metals and minerals along with agricultural commodities, we can gain further insight on the reasons for these contrasting signs by considering separately the two components. This is done in columns 3-6 of Table 8. The results show that the positive effect on the global factor is attributable to the price of metals and minerals, which has no significant effect on the group factors. In contrast, the agricultural commodities price index shows a significant negative association with the advanced-countries group factor. The coefficients of the other variables show little change relative to those in columns 1-3. The fit of the estimated models is quite good, although the sample is admittedly short. The R-squared range between 0.81 and 0.94, with the global factor showing the best fit and the emerging-market inflow factor the worst. The implication is that the common factor and "push vs pull" approaches are essentially equivalent. A small set of global variables can account for the bulk of the common shocks underlying capital flows worldwide, and thereby -in light of the variance decomposition results in Table 5 above -for a substantial portion of the variation in gross inflows and outflows around the world. The regression results also illustrate the contrasting effects across country groups of the real exchange rate of the U.S. dollar and commodity prices. Appreciation of the dollar encourages flows among advanced economies but discourages them among emerging economies -in line with the arguments provided by Bruno and Shin (2015b). In turn, increases in the relative price of non-energy commodities -in particular, agricultural commodities -affect negatively advanced-country flows, while encouraging flows globally.

Explaining countries' exposure to the international financial cycle
Many countries have undergone large capital flow shifts at times of global turmoil such as the 2007-2008 financial crisis or the 2013 'Taper tantrum'. Identifying the policies and structural features that determine the vulnerability of external financing flows to global shocks is a question of primary interest from the policy viewpoint. Section 4.3 analyzed the exposure of gross inflows and outflows to the common factors, as measured by the contribution of the latter to the standard deviation of flows (relative to trend GDP), and Table 6 showed that it exhibits considerable variation across countries. What ingredients are responsible for these large exposure disparities? To answer this question, we resort to regressions of exposure, measured as described, on a set of explanatory variables summarizing countries' key structural and policy features. 29 We use both financial and real variables. Among the former, we include financial openness -for which we use both de jure and de facto measures, respectively given by the Chinn-Ito index and the sum of foreign assets and liabilities as a ratio to GDP; financial depth (the ratio of credit to GDP); and the degree of flexibility of the exchange rate regime, as derived from the regime classification of Ilzetzki et al. (2019). To the extent that the common factors capture external financial shocks, we would expect financial openness to raise countries' exposure to them. Indeed,  find that financial openness increases the vulnerability of emerging markets' GDP growth to external monetary shocks. Financial depth might play a more ambiguous role -facilitating the propagation of external financial shocks but possibly also helping cushion them. Lastly, exchange rate flexibility should help dampen the response of capital flows to common shocks, to the extent that a more flexible exchange rate is able to absorb a larger part of the impact (e.g., Goldberg and Krogstrup (2018)), although the influential work of Rey (2013) and Miranda-Agrippino and Rey (2015) sheds doubt on such presumption. In turn, the real variables include overall market size, as measured by the log of real GDP; macroeconomic volatility (the standard deviation of real GDP growth); trade openness, proxied by imports plus exports as percent of GDP; and commodity specialization, measured by the ratio of net exports of commodities to GDP. A larger market size should raise overall exposure, to the extent that international investors tend to be more active in bigger markets offering easier rebalancing opportunities (Eichengreen and Gupta (2015)). 30 Macroeconomic volatility likely has negative effects, if higher volatility results at the margin from greater domestic shocks and hence entails a smaller relearlier literature has focused instead on their relative exposure, as measured by the share of the variance of flows attributable to common shocks. This is typically done by assessing the covariates of the common factor loadings: with flows and factors standardized to unit variance, as is customary in latent factor models, the loadings map into the variance share of the factors -i.e., each factor's share is just given by the square of its loading. Thus, Cerutti et al. (2017a) follow this approach in their analysis of bond and equity inflows to emerging markets, while Barrot and Serven (2018) do the same with total inflows and outflows for a sample of advanced and emerging markets.
ative (although not necessarily absolute) role for common shocks; larger volatility might also discourage international investors from participating in a country's asset markets. Openness to trade offers another avenue for the propagation of external disturbances, and thus in principle it should have a positive effect on exposure. Lastly, the effect of commodity specialization is more uncertain, although to the extent that global capital flow fluctuations are partly driven by commodity prices (as argued by Reinhart et al. (2017)), countries more highly specialized in the production of commodities should be expected to be also more exposed to common capital flow cycles. 31 We use as regressors the averages of these variables over the entire sample period employed in the estimation of the factor model, so that the regressions only use cross-sectional variation. Hence, the results should be taken with some caution, as the explanatory variables have likely undergone significant changes over that time span. This should tend to weaken the results of the regressions, so that they might be viewed as providing a lower bound on the magnitude and significance of the coefficients. The regression results are reported in Table 9. We drop Ireland from the country sample because of the extreme values of the dependent variable shown in Table 6 (however, results including Ireland, shown in Table A.8 in appendix A, are broadly similar).
Column 1 of Table 9 shows the results of univariate regressions; hence the coefficient estimates capture simple correlations. As conjectured, exposure to common shocks is significantly positively correlated with both de jure and de facto financial openness, as well as financial depth and trade openness. However, it is negatively correlated with the degree of commodity specialization. The specifications in columns 2-7 use de jure financial openness, while those in columns 8-9 employ de facto financial openness. Both are robustly positive and significant. Column 2 adds exchange rate flexibility and financial depth. Their respective parameter estimates are negative and positive, and both are significant. Barrot and Serven (2018) likewise find that exchange rate flexibility significantly reduces the impact of global shocks on gross capital inflows (although not outflows).
Columns 3 and 4 respectively introduce market size and aggregate volatility in the specification. Neither is significant, and the other coefficients exhibit only modest changes, although exchange rate flexibility falls just short of significance in column 4. Column 5 adds trade openness, which carries a positive and significant coefficient; however, financial depth becomes insignificant. The specification accounts for over half the variation of the dependent variable. Commodity specialization is added in column 6. Its coefficient estimate is well short of statistical significance, and the overall precision of the regression declines. Finally, column 7 re-estimates the specification in column 6 using a procedure robust to influential observations. All the explanatory variables, except for financial depth and commodity specialization, carry significant coefficients -including market size and macroeconomic volatility, whose parameter estimates are positive and negative, respectively. Columns 8-9 repeat the estimations shown in columns 6-7, respectively, replacing de jure with de facto financial openness. Qualitatively, the estimates are broadly similar. The main difference is that the coefficient on trade openness becomes much smaller, even changing sign and losing significance in column 8. However, the explanatory power of the specification rises considerably, to account for over 80 percent of the variation of the dependent variable. Lastly, the estimates in column 9 are very similar to those in column 7 in terms of sign and significance -all variables except commodity specialization and financial depth carry significant coefficients. What can we conclude from these empirical exercises? Financial openness -whether de jure or de facto -and the degree of flexibility of the exchange rate regime appear to emerge as fairly robust determinants of the exposure of advanced and emerging markets to the international financial cycle. Openness raises exposure, while exchange rate flexibility reduces it. For the other regressors considered, results are more fragile across specifications. What is the economic significance of these results? Consider a one-standard deviation increase in the degree of capital account openness and exchange rate flexibility. The former amounts to raising financial openness from the sample average level observed in, say, Peru, to the full openness of the Netherlands. The latter policy change would turn a pegged regime into a narrow crawling peg or band, or a managed float into a free float. Switching from a peg all the way to a free float would amount to a four-standard deviation change.
The impact of these policy changes on the exposure of aggregate capital flows to common shocks varies across the different columns of Table 9. If we take the estimates in column 6, for example, the increase in financial openness would raise exposure by 1.1 percent of trend GDP. In turn, the increase in exchange rate flexibility by one standard deviation would lower exposure by 1 percent of trend GDP. Table 6 showed that, on average, the exposure attributable to the international financial cycle is around 5 percent of trend GDP, with a standard deviation around 5-6 percent. Thus, these policy changes would change exposure by about one-fifth of its standard deviation. A more radical policy change, such as replacing a pegged exchange rate with a free float -with other things equal -would reduce exposure by four-fifths of its standard deviation.

Trends in globalization
Following the global crisis of 2007-2008, the fall of international capital flows -especially marked in the case of cross-border bank lending -has raised the question of whether financial globalization is undergoing a reversal (e.g, Forbes (2014)). What should be the proper measure of financial globalization in this context has been subject of debate (Cerutti and Zhou (2017), McCauley et al. (2017)). Our framework allows us to shed light on this issue, as it yields a natural measure of the overall degree of financial globalization, given by the exposure of countries' cross-border flows to common shocks, as discussed above. Thus, to assess the trends in globalization we reestimate the factor model over rolling 20-year windows and recalculate at each step the fraction of the standard deviation of flows, relative to trend GDP, attributable to the common factors. 32 Figure A.6 in appendix A shows that the windowspecific estimates of the common factors obtained in this way track fairly closely their full-sample counterparts. Figure 6 summarizes the trends in exposure to common shocks computed in this manner. The graphs show the average exposure over each window, denoted by its respective end-year, along with 95-percent confidence bands derived from the block bootstrap procedure. 33 For the sample as a whole, shown in the top graphs, average exposure rose steadily until the onset of the global crisis in 2007, from just under 3 percent of trend GDP in the initial window to over 6 percent at the peak, and stagnated -or even declined slightly -post-crisis. In the final window, exposure remained above 5 percent of trend GDP, pointing to a substantial (and statistically significant, according to the 95 percent confidence bands) rise in financial globalization since the beginning of the period of analysis.
The middle graphs show that the rise was especially marked among advanced countries -from 3 percent of trend GDP initially, to over 8 percent at the pre-crisis peak and a subsequent plateau at around 8 percent. While the initial rise is statistically strongly significant, the slight post-crisis decline that the figures suggest is not, given the overlap between the 95 percent confidence regions at the peak and at the end of the sample. The rise was also noticeable, albeit of smaller magnitude, among emerging countries (bottom graphs) -from 2-3 percent of trend GDP to just under 5 percent at the peak. After the post-crisis decline, the estimated exposure of flows to common shocks in the final window remains above the initial-window level, but the poor precision of the estimates does not allow firm conclusions regarding the extent, or even the presence, of the rise in globalization between the beginning and the end of the sample. Overall, these results do suggest a cycle of financial globalization ascent and subsequent stagnation, especially pronounced among advanced countries, with the global financial crisis separating the two phases. 34 33 We exclude Ireland from these figures because of its extremely high exposure to common shocks (as shown in Table 6). Including Ireland exaggerates the rising time profile shown in the figure. 34 Appendix B shows that the results for advanced and emerging countries are little changed if developing countries are added to the analysis. In turn, developing-country outflows exhibit also increasing average exposure to common shocks in their outflows prior to the crisis. Inflows, however, show a somewhat irregular pattern, with declining exposure at first, followed by a sustained rise after 2005. One possible reason for this differential behavior vis-a-vis the other country groups is the larger role of official flows (including development assistance) in developing-country inflows.

Conclusions
Recent episodes of worldwide financial turmoil have raised new concerns among policy makers regarding the vulnerability of their economies to shifts in international financial flows driven by global disturbances. This has prompted renewed interest in the policy measures that might help mitigate countries' exposure to financial shocks originating beyond their national borders. This paper has attempted to shed some light on these questions using a latent factor model to analyze jointly the gross inflows and outflows of a large number of countries. Estimation of the model takes advantage of recent methodological advances in the principal-component approach to factor models. Overall, the paper finds that capital flows exhibit a substantial degree of commonality. The implication is that the international financial cycle is quantitatively quite significant, contrary to the conclusions of some recent literature. The discrepancy is primarily due to the fact that previous studies have focused on individual types of flows at quarterly frequency, while we focus on aggregate flows -likely more relevant from the macroeconomic perspective -at annual frequency. Still, there are major contrasts across country groups, along two dimensions: first, the role of common shocks -both global and group-specific -is considerably bigger for advanced countries than for the rest. Second, among the former countries inflows and outflows reflect essentially the same common shocks, but this is not the case among other countries. In addition, there have been marked changes over time as well. The exposure of capital flows to the international financial cycle, which had risen steadily prior to the global crisis -especially among advanced countrieshas stagnated or even declined slightly in its aftermath. However, exposure remains at present well above its levels at the beginning of the sample period analyzed in the paper. In the policy dimension, the paper finds that the degree of openness of the capital account and the flexibility of the exchange rate regime matter for the exposure of capital flows to the international financial cycle: exposure is significantly higher in countries more financially open and with less flexible regimes. This suggests that, in spite of the global trend towards more open capital accounts, the choice of exchange rate regime still 29 matters for the international propagation of financial turbulence.  Emerging-country inflow factor     USA  GBR  AUT  DNK  FRA  DEU  ITA  NLD  NOR  SWE  CHE  CAN  JPN  FIN  IRL  PRT  ESP  AUS  NZL  TUR  ZAF  ARG  BRA  CHL  COL  MEX  PER  URY  VEN  CYP  ISR  JOR  KWT  OMN  SAU  EGY  IND  KOR  MYS  PAK  PHL  SGP  THA  MAR  CHN  POL Table 1: Information criteria scores. The numbers in the "Model" column correspond to the number of factors in each group (r G ; r R 1 , r R 2 ; r D 1 , r D −1 ; r RD 1,1 , r RD 1,−1 , r RD 2,1 , r RD 2,−1 ). The standardized score is computed as (IC p2 /IC p2,max +HQ2/HQ2 max )/2. The rank is based on the standardized score. The maximum number of factors considered was (3; 3,3; 3,3; 2,2,2,2).           (8) and (10) implement robust regression, excluding data with Cook's D >1, applying Hubert's weights until convergence and then bi-weights until convergence.

A Additional tables and figures
Figure A.1: Histograms of the correlation coefficients of the residuals of the estimated model, and standard deviation of the residuals. The graphs in the top two rows report the correlations of inflows and outflows, respectively, across countries within the same group (excluding within-country correlations). The graphs in the third row report the correlations of both inflows and outflows in each group with the flows of all other countries regardless of group membership and flow direction (excluding within-country correlations). The graphs in the fourth row report within-country inflow-outflow correlations. The graphs in the bottom row report the standard deviation of the residuals. Note that the cross-country correlations lie around zero, while the within-country inflow-outflow correlations (fourth row) are positive and large. There is also evidence of heteroskedasticity (bottom row). A Pesaran (2015) CD test of the null of weak cross-sectional dependence (based on the correlations shown in the rightmost graph of the third row) yields a p-value of 0.169, failing to reject the null.     . Columns (8) and (10) implement robust regression, excluding data with Cook's D >1, applying Hubert's weights until convergence and then bi-weights until convergence.

B Results including developing countries
In this section we report model estimation results for the expanded sample that includes developing countries. Table B.1 shows the results of the model selection via the information criteria. Here we consider two groupings, one featuring 3 groups (advanced, emerging, and developing countries) and another one featuring 2 groups (advanced, and emerging plus developing countries); in addition, we also consider models with a single group. Table B.1 shows that models with a multilevel structure obtain larger scores than those with a single level. Model (1; 1,0,0; 2,0; 0,0,0,0,1,0) (consisting of 1 global factor, 1 for advanced countries, 2 for inflows and 1 for developing inflows) is the one achieving the highest score, closely followed by model (1; 1,0; 0,0; 0,0,1,0) (including 1 global factor, 1 for advanced countries and 1 for emerging and developing inflows), which is ranked first by the IC p 2 criterion. The former model features two inflow factors that are not orthogonal to the advanced-country group factor (the correlation coefficients are -0.56 and 0.31). All three of them affect advanced-country inflows, which complicates the interpretation of the factors. For this reason, and given the small difference is standardized score, we instead select model (1; 1,0; 0,0; 0,0,1,0). Table B.2 shows the correlations between factors and loadings of the selected model with those of the other models with the highest scores. The correlations are rather large (always over 0.93), except for the Emerging and Developing inflows factor and loadings with the inflows factor and loadings of models (1; 10; 10; 0010) and (1; 10; 20; 0010). In these two cases, however, the set of all the factors (loadings) affecting inflows and emerging and developing inflows spans almost perfectly the emerging and developing inflows factor (loadings) of the selected model (the correlation between the factor -loading-of the selected model and its projection over the factors -loadings-of the other models exceeds 0.99). This indicates that the results are not sensitive to the particular model selected.  Table B.3 shows that the loadings of developing countries on the global factor tend to be smaller, and sometimes significantly negative, while their loadings on the emerging and developing inflows factor tend to be somewhat larger than those of the emerging countries. This suggests that the emerging and developing inflows factor from the expanded sample is relatively more closely related to developing countries. As with the factors, the correlations across samples of the loadings of advanced and emerging countries, respectively, are very high. For the global factor loadings, the correlation equals 0.996; for the advanced-country factor loadings, the correlation equals 0.998. In turn, the correlation of the emerging countries' loadings on the emerging-country inflow factor with those on the emerging and developing inflow factor of the expanded sample equals 0.806. We conclude that the model estimation results are not sensitive to the inclusion of developing countries in the sample.  AUT  DNK  FRA  DEU  ITA  NLD  NOR  SWE  CHE  CAN  JPN  FIN  IRL  PRT  ESP  AUS  NZL  TUR  ZAF  ARG  BRA  CHL  COL  MEX  PER  URY  VEN  CYP  ISR  JOR  KWT  OMN  SAU  EGY  IND  KOR  MYS  PAK  PHL  SGP  THA  MAR  CHN  POL  ROM  BOL  CRI  DOM  ECU  SLV  GTM  HTI  HND  NIC  PAN  PRY  JAM  TTO  BGD  MMR  LKA  NPL  BWA  CMR  BEN  ETH  GHA  LSO  MDG  MWI  MUS  NGA  RWA  SLE  SDN  SWZ  TZA  TUN  UGA  FJI  PNG  ALB  BGR USA  GBR  AUT  DNK  FRA  DEU  ITA  NLD  NOR  SWE  CHE  CAN  JPN  FIN  IRL  PRT  ESP  AUS  NZL  TUR  ZAF  ARG  BRA  CHL  COL  MEX  PER  URY  VEN  CYP  ISR  JOR  KWT  OMN  SAU  EGY  IND  KOR  MYS  PAK  PHL  SGP  THA  MAR  CHN  POL  ROM  BOL  CRI  DOM  ECU  SLV  GTM  HTI  HND  NIC  PAN  PRY  JAM  TTO  BGD  MMR  LKA  NPL  BWA  CMR  BEN  ETH  GHA  LSO  MDG  MWI  MUS  NGA  RWA  SLE  SDN  SWZ  TZA  TUN  UGA  FJI  PNG  ALB  BGR Table B.1: Information criteria scores in the sample including developing countries. The numbers in the "Model" column correspond to the number of factors in each group (r G ; r R 1 , r R 2 , r R 3 ; r D 1 , r D −1 ; r RD 1,1 , r RD 1,−1 , r RD 2,1 , r RD 2,−1 , r RD 3,1 , r RD 3,−1 ). The standardized score is computed as (IC p2 /IC p2,max +HQ2/HQ2 max )/2. The rank is based on the standardized score. The maximum number of factors considered was (2; 2,2,2; 2,2; 1,1,1,1,1,1) in the Adv, Eme, Dev grouping and (3; 3,3; 2,2; 1,1,1,1) in the Adv, Eme+Dev grouping.  Table B.2: Correlations of the factors and loadings of the different models with those of the (1;10;00;0010) model (the selected one), in the sample including developing countries. The emerging& developing inflow factor (loadings) of the selected model is compared with the first inflow factor (loadings) of the other models. In brackets is the correlation between the emerging and developing inflows factor (loadings) of the selected model and its projection over the (2 or 3) factors (loadings) of the corresponding model affecting only inflows.  As noted in the main text, our results regarding the variance contribution of the estimated factors stand in contrast with those of Cerutti et al. (2017c), who report much smaller figures. From this they conclude that the 'global financial cycle' (or, more broadly, common shocks) is a relatively minor force behind capital flows. There are five main differences between our analysis and that of Cerutti et al. (2017c): the frequency of the data (yearly in this paper versus quarterly in theirs), the level of aggregation of capital flows (total flows versus inflows disaggregated into FDI, portfolio debt, portfolio equity and bank credit), the estimation method (principal components versus Bayesian), the normalization of the flows (by trend GDP 35 versus current GDP), and the estimation sample, both regarding country coverage as well as time frame (1979-2015 versus 1990Q1-2015Q4). In Tables C.1 and C.2 we show that the first two differences account for the bulk of the discrepancy. Using the data of Cerutti et al. (2017c) 36 we reestimate the two factors they consider (one derived from advanced non-central countries, the other from major emerging markets) 37 using the standard principal components approach, which estimates the factors as the eigenvalues of the sample covariance matrix. Since the data are not a balanced panel, we deal with missing values 38 by estimating the sample covariance matrix as:  Cerutti et al. (2017c), the advanced non-central countries are Australia, Canada, Iceland, New Zealand, Norway, Sweden (large and safe-haven economies are excluded); the emerging countries are Brazil, Chile, China, Indonesia, Korea, Mexico, Philippines, Poland, the Russian Federation, South Africa, Thailand and Turkey (MSCI members with weight larger than 1%). We note that estimating a factor with data from only 6 or 12 countries can be imprecise, potentially leading to factors with smaller explanatory power. 38 In the data file supplied by Cerutti et al. (2017c) there are, aside from missing values, a number of flows taking the value of exactly zero; we treat those as missing values.
where Y t,i is a particular flow type of country i at time t, D t,t is the set of countries with data for flow Y for time periods t and t and N t,t is the number of such countries. As done in the main text, the flow data are standardized by subtracting the mean and dividing by the standard deviation of the respective time series (before computing the covariance matrix (C.1)). Comparing the first two rows of Table C.1 we see that using the simple principal component estimator yields a very small increase of the average adjusted R 2 (R 2 ), from 0.054 (corresponding to the 0.05 average shown in their appendix figure A7), to 0.075 when analyzing disaggregated flow data at quarterly frequency. Considering instead total inflows and outflows (obtained by summing all flow types, in the fourth line of the table) leads to another increase in R 2 . In, turn, the same happens when we consider the disaggregated data at yearly, rather than quarterly, frequency (lines 6-7 of Table C.1). With any of these two changes we obtain R 2 around 0.125. We note that when considering flows at the yearly level, the factor estimation method seems to make less of a difference. Normalizing by trend instead of nominal GDP also leads to a modest increase in R 2 . If flow aggregation and yearly frequency are combined, the R 2 rises above 0.2, almost four times the initial 0.054 value. Unlike ours, the framework of Cerutti et al. (2017c) includes only two group factors and no global factors. One way to assess how this affects their results is to add to their setup one more factor per group, as a crude way of capturing the contribution of the global factor to the variance of inflows in each of their country groups. These extra factors are computed as the second principal components of the non-central advanced and emerging-country inflows, respectively. Doing this raises the R 2 to 0.274. The 63 'non-large' countries considered by Cerutti et al. (2017c) are mainly emerging (although Australia, Canada, Denmark, Norway, New Zealand, Sweden, Switzerland, Iceland and Hong Kong SAR, China, are also included). The R 2 we obtain for emerging countries with our data is 0.290, thus roughly similar (this is the adjusted R 2 ; the slightly larger values in Table 5 correspond to the unadjusted R 2 ). Taking all countries in our sample, but excluding US, UK, GER, CHE and JPN, we obtain 0.376; if we further exclude all EMU countries, we obtain 0.315. If we examine the explanatory power of the estimated factors for the flows of advanced countries (those with "ad"=1 or "nonlarge"=0 in the Cerutti et al. (2017c) data), we obtain the results shown in the middle section of the table. The R 2 equals 0.07 with disaggregated flows at the quarterly frequency and raises to 0.18 when considering yearly frequency. Aggregating over flow types, the R 2 increases up to 0.41 and further to 0.47 if two additional factors are used (these numbers are 0.21, 0.44 and 0.45 if flows are normalized by trend GDP). Normalizing by trend GDP rather than current GDP also tends to increase the explanatory power of the factors, but only by modest amounts -i.e., by 2.1 percentage points on average, and never by more than 3.5. With our data we obtain an average R 2 over advanced countries of 0.575; the difference can be ascribed to the different time sample (1990-2015 versus 1979-2015) and particular countries considered. Table C.2 shows how these results change when we add to the common factors, like in Cerutti et al. (2017c), 8 U.S. financial and real variables. 39 Again considering yearly data and total flows leads to a very large increase in R 2 -from 0.12 to 0.45 for small countries and from 0.18 to 0.61 for advanced countries. In this setting, normalizing by trend GDP also leads to small increases in R 2 . The conclusion from this analysis is that the global financial cycle is a much stronger force at the yearly frequency and for total capital flows than at the quarterly frequency and for individual types of capital flows. The likely reason is that particular types of flows at high frequencies are significantly affected by shocks specific to the flow type and/or the particular quarter that cancel out when aggregating across flows and/or over time.  Adv .183 .191 .175 .228 .250 .154 .115 .206 .133 .195 Table C.1: Average of the adjusted R 2 from regressing the flows shown on a factor estimated from 6 non-central advanced countries and another factor estimated from 12 emerging countries. The sample "Adv." corresponds to advanced countries (characterized by nonbig=0 or ad=1 in Cerutti et al. (2017c) data), while "Small" correspond to 63 non-large countries (characterized by nonbig=1 in Cerutti et al. (2017c)). "CCR" uses the factors provided in Cerutti et al. (2017c); "PC" stands for factors estimated using the principal components estimator; "Aggr." indicates that all flow types are summed; "Yearly'"indicates that the quarterly factors are aggregated to the annual level (rather than being estimated with the yearly data); "Trend" indicates that flows are normalized by trend GDP (computed using HP filter with parameter 100 at yearly frequency), as opposed to current GDP, indicated as "Curr."; "PC 2" indicates that 2 factors from advanced and 2 factors from emerging countries are used. Regressions with less than 10 degrees of freedom are excluded. Values in the first row correspond to those in figure A7 of Cerutti et al. (2017c). When using disaggregated flow data, the column "All types" shows, following Cerutti et al. (2017c), the average the adjusted R 2 over FDI, portfolio equity, portfolio debt, bank credit and total portfolio (portfolio debt plus portfolio equity).  Table C.2: Average of the adjusted R 2 from regressing the flows shown on a factor estimated from 6 noncentral advanced countries and another factor estimated from 12 emerging countries, plus 8 US variables (VIX, nominal and real funds rate, TED spread, yield curve slope, GDP growth, growth in real effective exchange rate and M2 growth) . The sample "Adv." corresponds to advanced countries (characterized by nonbig=0 or ad=1 in Cerutti et al. (2017c) data), while "Small" correspond to 63 non-large countries (characterized by nonbig=1 in Cerutti et al. (2017c)). "CCR" uses the factors provided in Cerutti et al. (2017c); "PC" stands for factors estimated using the principal components estimator; "Aggr." indicates that all flow types are summed; "Yearly'"indicates that the quarterly factors are aggregated to the annual level (rather than being estimated with the yearly data); "Trend" indicates that flows are normalized by trend GDP (computed using HP filter with parameter 100 at yearly frequency), as opposed to current GDP, indicated as "Curr."; "PC 2" indicates that 2 factors from advanced and 2 factors from emerging countries are used. Regressions with less than 10 degrees of freedom are excluded. Values in the first row correspond to those in figure 5 of Cerutti et al. (2017c). When using disaggregated flow data, the column "All types" shows, following Cerutti et al. (2017c), the average the adjusted R 2 over FDI, portfolio equity, portfolio debt, bank credit and total portfolio (portfolio debt plus portfolio equity).