External sustainability in Spanish economy: Bubbles and crises, 1970–2020

We address the issue of the sustainability Spain’s exter-nal debt, using data for the period 1970–2020. To detect episodes of potentially explosive behavior of the Spanish net foreign assets over GDP ratio and the current account balance over GDP ratio, as well as episodes of external adjustments over this long period, we employ a recursive unit root test approach. Our empirical analysis leads us to conclude that there is some evidence of bubbles in the ratio between Spanish net foreign assets and the GDP. In contrast, the evidence that the ratio between the Spanish current account balance and the GDP had explosive subperiods is very weak. The episode of explosive behavior identified in the position of net foreign assets during the period 2002–2015 was the result of the country’s economic expansion 1995–2007. The results also show an external


INTRODUCTION
One of the central themes of modern international macroeconomic theory is the analysis of global imbalances and their sustainability.Probably one of the most important macroeconomic problems, facing both academics and policy makers, is that of external imbalances, which in most countries include many factors, from saving to investment to portfolio decisions.These cross-country differences in patterns of saving and investment and portfolio choices are partly "good," a natural reflection of differences in levels of economic development, demographic patterns, and other underlying economic fundamentals.But they are also partly "bad," indicating externalities, distortions, and risks, at the national and international levels.Therefore, it is not surprising that the issue is highly controversial, and that there is disagreement on the diagnosis and consequently on the policies to adopt (Blanchard & Milesi-Ferretti, 2009).
The analysis of current account deficits and their sustainability has gained impetus since the 2007-2011 international financial crisis.The fear of countries defaulting on their external debt have increased during the last few years after some countries of the euro area have shown relatively high ratios of both internal and external debt to GDP.The flow of funds approach, based on basic international macroeconomic theory, predicts that net exports should equal public saving plus private saving net of investment.Hence, there is a direct connection between internal imbalance and external imbalance.
As consequence of this recent international financial and economic crisis, many countries have taken austerity measures in order to reduce debt levels, both internal and external.These adjustment policies have been motivated by high levels of debt accumulation and the urgency for some peripheral countries to be bailed out by the European Union in a move to cut down their debt burden and lower the risk premia of their bonds.If these increases in accumulated debt, both internal and external, are due to greater financial integration (Blanchard, 2007;Blanchard & Giavazzi, 2002) or to excessive optimism during the "Great Moderation" (Blanchard & Milesi-Ferretti, 2009;Jaumotte & Sodsriwiboon, 2010), the urgency to act is justified.
In this article, we provide a test of the sustainability of external imbalances for the case of Spain for the period 1970-2020.The Spanish case can be of interest given that Spain experienced current account deficits in 63% of the years belonging our sample period.To detect episodes of potentially explosive behavior of the ratio of the Spanish net foreign assets to GDP and of the ratio of the current account balance to GDP, we use recent recursive unit root tests for explosiveness proposed by (Phillips et al., 2011;Phillips et al., 2014), and (Phillips et al., 2015a,b).
The scheme of this article is as follows.Section 2 presents the article's connections with the literature.Next, in Section 3 we introduce the econometric methods.Section 4 presents and discusses the main empirical results.Section 5 draws the main conclusions.

THEORETICAL FRAMEWORK
The sustainability of external deficits, also referred to as current account sustainability, is related to the issue of long-run solvency.Long-term sustainability of the current account deficit is considered to exist if it does not breach the nation's solvency constraint.Furthermore, a nation is supposed to be solvent if, at any time, the net present value of primary surpluses is greater than or equal to the unpaid external debt.In other words, external sustainability requires that a country be able to repay its debt at some point in the future without defaulting on some of its liabilities.
However, the ratio of external debt to GDP would increase if the interest rate on the external debt exceeds the growth rate of the economy.In this case, only a surplus in the ratio of the current account balance to GDP could stop the dynamics of debt accumulation.
The standard approach to studying the sustainability of external imbalances is founded on the intertemporal approach to the current account.In this approach, any change in the net indebtedness of a country is considered as an intertemporal choice, while changes in the level of indebtedness imply future alterations in national consumption, which are determined by changes in the expectations of a wide set of macroeconomic variables.Seminal papers on the intertemporal models of the current account include, among others, Sachs (1981Sachs ( , 1982)), (Obstfeld, 2012), Svensson and Razin (1983), Obstfeld and Rogoff (1995), Razin (1995), Milesi-Ferretti andRazin (1996).
The starting point of the intertemporal approach to the current account is some accounting identities.In period t, the current account, that is, the change in net foreign assets vis-à-vis the rest of the world, equals net exports of goods and services plus net factor payments from abroad, where CA, NFA, and NX stand for the current account, net foreign assets and net exports, respectively, all of them in real terms; Δ is the difference operator; and r is a (constant) real interest rate.Note that when NFA > 0, the country is a net creditor, and when NFA < 0, the country is a net debtor.Alternatively, where Q is the GDP (so, Q + rNFA t−1 ) is the gross national product), and C, S, and I denote the total (i.e.private plus public) consumption, saving and investment, respectively.Thereby, Equation (2) links the current account balance with decisions about saving and investment.Since Equation (1) holds every period, solving for NFA t and iterating forward over an infinite horizon yields the Intertemporal External Budget Constraint (IEBC), written in terms of GDP shares, where nfa and nx denote, respectively, net foreign assets and net exports, both as ratios to GDP; E is the expectations operator; and g stands for the rate of growth of real GDP, assumed (just as with the real interest rate) to be constant for simplicity.Equation (3) simply states that international agents are able to lend to an economy if they expect that the present value of the future stream of net export surpluses equals the current stock of foreign debt.Hence, the sustainability hypothesis, or long-run external budget constraint implies that, This transversality condition (TC) means that the present value of the expected stock of debt when t tends to infinity must be zero, which is a no-Ponzi game condition; or, equivalently, ) j+1 E t nx t+j+1 .
(5) Equation ( 5) simply states that solvency requires that the country must run expected future trade surpluses equal, in present-value terms, to the current value of its outstanding net liabilities vis-à-vis the rest of the world.
The empirical literature on external solvency is abundant and has developed implementations of various methods for testing the fulfillment of the TC. 1

3.1
The standard approach to testing for the sustainability of the current account In the literature, a common approach to evaluating the sustainability of an external policy is to determine whether there is cointegration between net exports and the (lagged) level of net foreign assets, both as ratios to GDP.As a result, a negative and significant estimate of the cointegration parameter would be a sufficient condition for solvency, indicating that the nation satisfies its present-value budget constraint.Alternatively, the cointegration parameter would be equal to 1 in a cointegration equation between the GDP ratios of the exports of goods and services, and the imports of goods and services plus net interest payments and net transfer payments.Bohn (2007) published a harsh critique of these procedures (unit root and cointegration conditions) describing them as assessing sustainability as a mere "mechanical exercise."Bohn (2007) demonstrated that testing the IEBC based on unit root and cointegration tests is incapable of rejecting external sustainability. 2More specifically, Bohn (2007Bohn ( , 2008) ) proved that the series of net foreign assets, when integrated of any finite order, satisfies the sustainability condition (4).This is because a stochastic process integrated to order n can be approximated by a polynomial of order no higher than n.External unsustainability would imply explosive debt dynamics.However, the standard unit root and cointegration tests, by construction, do not consider explosive dynamics as a hypothesis, and these tests only discriminate between different orders of integration.
Moreover, Bohn (1998) argued that tests based purely on time-series properties of net foreign assets and net exports miss the general equilibrium conditions linking external balance to the rest of the economy.Bohn's "model-based-sustainability" framework suggests estimating econometrically the conditional relation between net foreign assets and net exports.For him, error correction-type policy reaction functions are more promising for understanding external deficit problems.Moreover, cointegration between exports and imports is not a necessary condition for the no-Ponzi game condition to hold, but a long-run relation as an error-correction specification between nfa t and nx t has to be fulfilled in order to avoid any explosive outcome among the variables that determine the external equilibrium in the long run.
This procedure based on a policy reaction function has been applied in previous analyses of the sustainability of external imbalances in Spanish economy.First, Camarero et al. (2013) tested for external sustainability using several types of cointegration and multicointegration tests of a group of 23 OECD countries for the period 1970-2012, including Spain.Their results pointed to the existence of external weak sustainability for all the countries in the sample when considering the traditional flow approach to the external intertemporal budget constraint.However, when applying a stock-flow approach, some degree of strong sustainability was found for up to six countries, including Spain. 3  Second, (Bajo-Rubio et al., 2014) tested for the sustainability of external imbalances in the OECD countries over the period 1970 to 2007, addressing the recent critique of Bohn (2007) of previous unit root and cointegration tests of the IEBC and allowing for the valuation effects emphasized by Gourinchas and Rey (2007).In the case of Spain, no clear-cut results emerge, that is, the IEBC would fail in principle to hold but, since Bohn's approach gives only sufficiency conditions, a failure of the tests does not mean a rejection of external sustainability.

3.2
A model on recurrent explosive external debt and long-run external sustainability Evans (1991) argued that standard right-tailed unit root tests, frequently used to evaluate long-run fiscal sustainability, have little power to detect periodically collapsing bubbles when applied to the full sample (explosive behavior is only temporary) and demonstrated this effect in simulations.The low power of standard unit root tests is due to the fact that periodically collapsing bubble processes behave rather like an I(1) process or even a stationary linear autoregressive process when the probability of the collapse of the bubble is non-negligible, thereby fail to correctly interpret empirical evidence. 4 To overcome the problem identified in Evans (1991), Phillips et al. (2011), PWY henceforth) and Phillips et al. (2015a), Phillips et al., 2015b, PSY henceforth) developed a new recursive econometric methodology for real-time bubble detection that proved to have a good power against mildly explosive alternatives.The interest in a testing algorithm is whether a particular set or group of consecutive observations comes from an explosive process (H A ) or normal martingale behavior (H 0 ).The testing algorithm is based on a right-tailed unit root test proposed by Phillips et al. (2014).
On the one hand, the martingale null is specified as, with constant k and  > 1∕2, and where y t is the data series of interest (in our case the ratio of net foreign assets to GDP; external debt) at period t,  t is the error term, and T is the total sample size.The hypothesis that  = 1 implies that y t is integrated of order one, that is, y t ∽ I(1).This can be interpreted as the condition of the long-run external sustainability under the assumption of a single sustainable external policy, that is, for all T.
On the other hand, the alternative is a mildly explosive process, namely, where  T = (1 + cT − ) with c > 0 and  ∈ (0, 1), and it must be indicated that this type of mildly explosive and collapsing behavior under the alternative hypothesis corresponds to, at least, one subperiod of the full sample, not to the whole sample.In this case, if  T > 1, this implies the explosive behavior of y t over sub-period t ∈ [T 1 , T 2 ]. 5 According to this approach, for any t ∈ [T 1 , T 2 ] the nfa t is characterized by an I(1) integrated process, which means that the external debt would be sustainable.Thus, the explosive behavior of external debt is not a sufficient condition for external unsustainability in sub-period [T 1 , T 2 ].For a fixed T, the economic policy implemented during sub-period [T 1 , T 2 ] would not be sustainable in the long-run if cT − > (r − g) (TC condition (4) were not satisfied).
In addition to the classic Evans (1991), Charemza and Deadman (1995) extends the above analysis to the case of multiplicative processes with a stochastic explosive root, which encompasses the non-negative processes used in the analysis of exuberant time series.The formulation of Equation ( 4), as a restrictive representation of the generating process under the null hypothesis, includes a particular, not standard, representation for the drift term.Given that, the recursive representation can be written as, where T 1∕2− → 0 as T → ∞, so that the drift term is asymptotically negligible and does not interfere with the standard asymptotics for a nonstationary process.

Recursive unit root test for explosiveness
The methodology developed in PWY and (Phillips et al., 2015a, Phillips et al., 2015b, PSY henceforth) can be applied to test the unit root hypothesis in the standard model of the sustainable external debt described in ( 6) against an alternative of multiple sub-periods of explosive behavior where the external debt dynamics is described in (7).Under this alternative, the sustainable external debt dynamics, which implies that nfa t is an I(1) integrated process, is interrupted by recurrent episodes of explosive debt dynamics.This can be interpreted as the result of fluctuating (sustainable/unsustainable) external policies contrary to the null hypothesis based on the assumption of a single (sustainable) external policy.
The testing procedure is developed from a regression model of the form: where  0 ,  1 , and  i are model coefficients, K is the lag order, and  t is the error term.The key parameter of interest is  1 .We have  1 = 0 under the null and  1 > 0 under the alternative hypothesis.The model is estimated by Ordinary Least Squares (OLS) and the t-statistics associated with the estimated  1 is referred to as the ADF statistics.
To begin with, PWY proposed a sup ADF (SADF) statistic to test for the presence of explosive behavior in a full sample.In particular, the test relies on repeated estimation of the ADF model on a forward expanding sample sequence, and the test is obtained as the sup value of the corresponding ADF statistic sequence.In this case, the window size (fraction) r w expands from r 0 to 1, where r 0 is the smallest sample window width fraction (which initializes the computation of the test statistic) and 1 is the largest window fraction (the total sample size) in the recursion.The starting point r 1 of the sample sequence is fixed at 0, so the endpoint of each sample (r 2 ) equals r w and changes from r 0 to 1.The ADF statistic for a sample that runs from 0 to r 2 is denoted by ADF r 2 0 .The SADF test is then a sup statistic based on a forward recursive regression and is simply defined as: 6 (10) Second, PSY developed a doubly recursive algorithm that enables bubble detection and consistent estimation of the origination (and termination) dates of the bubble expansions and episodes of crisis while allowing for the presence of multiple structural breaks within the sample period.They showed that when the sample includes multiple episodes of exuberance and collapse, the PWY procedures may suffer from reduced power and can be inconsistent, thereby failing to reveal the existence of bubbles.This weakness is a particular drawback in analyzing long time series or rapidly changing data where more than one episode of explosive behavior is suspected.
To overcome this weakness and deal with multiple breaks of exuberance and collapse, PSY proposed the backward sup ADF (BSADF) statistic defined as the sup value of the sequences of ADF statistics over the interval [0, r 2 − r 0 ].That is: where the endpoint of each subsample is fixed at T 2 = [r 2 T] where r 2 ∈ [r 0 , 1], and the starting point of each subsample, . PSY also proposed a generalized version of the sup ADF (SADF) test of PWY, based on the sup value of the BSADF.That is: The statistic ( 12) is used to test the null of a unit root against the alternative of recurrent explosive behavior, as the statistic (10).It is important to note, and it must be clearly stated, that the fact that the two sequential versions of the ADF test, given in Equations ( 10) and ( 12) as the sup values over the sequences of subsamples, implies that all these tests are right-tailed, that is, the rejection is obtained for large positive values.Moreover, these testing procedures provide a consistent estimation of the time points of initialization and burst of the explosive behavior when rejecting the null hypothesis.

Historical data
We consider a long historical time series in which many economic and financial crisis events are known to have occurred.The length of this database makes it especially suitable for the econometric approach adopted in this article.In our empirical analysis, we use the data for the 1970-2020, with 51 annual observations.The data and sources are: (a) the Spanish net foreign assets divided by the GDP, nfa t : 1970-1991 from (Lane & Milesi-Ferretti, 2006;Lane & Milesi-Ferretti, 2007), and 1992-2020 from Banco de España ( 2021); (b) the Spanish current account balances as a percentage of GDP, nx t : 1970-1979 from (Jordà et al., 2017), 1980-2020 from Banco de España (2021).Some descriptive statistics for both series are shown in Table 1. Figure 1 plots the data of the Spanish net foreign assets over GDP ratio series, nfa t , and shows quite clearly a stylized fact: the preeminence and persistence of the net debtor positions in Spanish economy, especially from 1995 onwards.While temporary current account deficits may simply reflect the reallocation of capital to countries where capital is more productive, persistent external deficits may be regarded as a more serious issue.External deficits may lead to increased domestic interest rates to attract foreign capital.However, the accumulation of external debt due to persistent current account deficits may imply increasing interest payments that impose an excess burden on future generations.
Figure 2 plots the series of the Spanish current account balances as a percentage of GDP, nx t , and clearly shows that the deficit of the Spanish current account balance in the period 2000-2009, reached historic levels, as a consequence of the boom-cycle of the Spanish economy 1994-2007, which generated an excessive macroeconomic imbalance between national savings and investment.
The evolution of the external balance during the sample period  allows us to distinguish two clearly differentiated episodes: the boom-bust cycle of the Spanish economy 1994-2007, and the periods before and after the global financial crisis of 2007-2008.
On the one hand, during the expansion of the Spanish economy 1995-2007 (with an average increase in nominal GDP of 3.4%) prior to the international financial crisis of 2007-2008, against an international background marked by low interest rates, optimistic expectations about economic growth and underpriced risks, the debt levels of households and non-financial corporations in the advanced economies increased markedly.In Spain this phenomenon became notably acute and debt ratios higher than those observed in other Eurozone countries were recorded.Single currency membership prompted an upward revision of expected incomes and set in place very loose financing conditions, whose expansionary effects on lending were not sufficiently countered by other economic policies.
The expansion was accompanied by a progressive concentration in transactions linked to the real estate market.Given the insufficiency of domestic saving for financing this expansion in lending, banks resorted to international debt markets.In this period, the Spanish economy recorded current-account deficits of a size unprecedented in the historical time series (see Figure 2).Thus, the negative ratio of current-account deficit o GDP was gradually increased from −4.3% to −9.4% in 2007.As a consequence, the financing of these deficits raised Spain's external debt to a very high level.Thus, the negative ratio of net foreign assets to GDP increased by 62.7% points of GDP between 2000 and 2009.Definitely, the wider debit balance vis-à-vis the external sector mainly reflects the Spanish economy's recourse to foreign savings to finance the expansion of private investment.As a result of this, the net foreign assets climbed to reach a historic peak of −97.6% of the GDP in 2009 (see Figure 1).This position combined foreign assets equivalent to 150.6% of GDP and liabilities of 246.5% of GDP.
A country's ability to pay is a important aspect in analyzing the sustainability of its external debt.The high levels of negative net foreign assets divided by GPP between 2000 and 2009 could be worrying for various reasons.First, it was one of the highest debtor positions in the world, so we must wonder whether Spain could afford it.Second, a high proportion of the total liabilities were in the form of debt and this, by requiring regular payments for interest and amortization, entails a greater vulnerability than other types of liabilities, such as shares and other forms of participation in corporate capital.Lastly, the negative balance of the ratio of net foreign assets to GDP were multiplied by a factor of almost 2.75 since the euro was adopted in 1999, which might suggest that an explosive dynamic is at work.However, although the proportion of negative net foreign assets to GDP was relatively high for 2000-2009, the cost of financing it was relatively modest: the average cost of liabilities and risk premiums were relatively low (except in the period from 2010 to 2012, due to the European sovereign debt crisis), the debt maturity structure was suitable, and the Spanish current account balance had improved notably since 2009, reaching a surplus in 2012.In short, the ability to pay was assured for the moment.Finally, the level of gross external debt in Spain, 166,1% of the GDP in 2009, did not compare unfavorably with other European countries.
On the other hand, during and after the global financial crisis, falling house prices, and a tightening of collateral constraints for Spanish borrowers contributed to a sharp reduction in capital inflows, and to the persistent slump in Spanish real activity.As a consequence, the Spanish current account balance underwent a sharp adjustment and improved notably.Specifically, there was a correction by some 11.4% points of GDP between 2007 and 2016, until reaching a surplus of 3.2%.
As a result of this, in 2019 the negative ratio of net foreign assets to GDP of the Spanish economy decreased for the fifth year running, to stand at 74% of GDP, its lowest level since 2006.These developments, which constituted the biggest fall in the last seven years, were underpinned by the nation's net lending position, the positive amount of valuation effects and GDP growth.In any event, the current level of external indebtedness constitutes a risk which must not be underestimated.Reducing the negative net foreign assets to less vulnerable levels will require running current account surpluses over a long period of time.The improvement of the negative net a Superscripts 1,2,3 indicate significance at the 10%, 5% and 1% levels, respectively.b Structural breaks affect the slope of the time trend (Model I: "slope change" or "changing growth") or affect the intercept and the slope of the time trend (Model II: "mixed change: crash and changing growth") T numbers of breaks.
c The critical values were obtained from simulations using 1000 steps to approximate the Wiener process and 10,000 replications.
foreign assets position depends on the current and capital accounts, on nominal GDP growth and on interest rates.But in 2020, as a result of the COVID-19 pandemic and the decrease in the current account surplus (only up to +0.7% as a percentage of GDP), the ratio of net foreign assets to GDP worsened again, to −84.4% level.This increase was mainly due to the sharp fall in GDP and the decline in the value of external financial assets because of the appreciation of the euro.
The Macroeconomic Imbalance Procedure (MIP) of the Eurozone is a surveillance mechanism that is meant to detect potential macroeconomic risks from the start, prevent the emergence of harmful macroeconomic imbalances, and correct imbalances that are already in place. 7 8One of the more significant indicators of these is the ratio the net foreign assets to GDP, or the net international investment position divided by the GDP, according to the terminology of IMF and Eurostat, with a threshold of −35%.The current imbalance of −84.4% is a long way from this threshold.

Stationarity of the time series
The first step in our analysis is to examine the time series properties of the series by testing for a unit root over the full sample.On the one hand, for the analysis of the order of integration, when a structural change is not present, we have used a modified version of the test of Phillips and Perron (1988) proposed by Ng and Perron (2001), who try to solve the main problems present in these conventional tests for unit roots.This methodology consists of a class of modified tests, called M GLS , originally developed by Stock (1999) as M-tests, and computed after detrending the series under analysis using the GLS methodology as proposed by Elliott et al. (1996).Such modifications improve the tests with regard to both size distortions and power.According to the results in Table 2, the null hypothesis of non-stationarity cannot be rejected at the 5% level of significance.
On the other hand, given the previous analyses in the literature and the expected effects of the different economic crises that might have affected the Spanish net foreign assets and the Spanish current account balance, we also examine the order of integration of the series investigating the presence of structural breaks.Trend breaks appear widely in macroeconomic time series, and therefore unit root tests must take them into account if the tests are to avoid the serious effects that unmodeled trend breaks have on power. 9In a seminal paper, Perron (1989) shows that failure to 14679396, 2023, 1, Downloaded from https://onlinelibrary.wiley.com/doi/10.1111/roie.12611 by Universitat De Valencia, Wiley Online Library on [21/03/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License take into account trend breaks present in the data results in unit root tests with zero power, even asymptotically.Therefore, when testing for a unit root, dealing with this type of deterministic structural change has to become a matter of regular practice.To avoid this problem, we run tests to assess whether structural breaks are present in the time series.
Regarding the analysis of the order of integration when structural changes are present, we have used the GLS-based unit root tests with multiple structural breaks under both the null and the alternative hypotheses proposed in Carrion-i-Silvestre et al. (2009).The commonly used tests for unit root with a structural change in the case of an unknown break date (Zivot and Andrews (1992), Perron (1997), Vogelsang and Perron (1998), Perron andVogelsang (1992a, 1992b)), assume that if a break occurred, it will only do so under the alternative hypothesis of stationarity.The methodology developed by (Carrion-i-Silvestre et al., 2009) solves many of the topical problems in standard unit root tests with a structural change in the case of an unknown break date. 10Carrion-i-Silvestre et al. ( 2009) consider the modified unit root tests (M-class tests) analyzed by Stock (1999), Perron and Ng (1996) and Ng and Perron (2001).Carrion-i-Silvestre et al. ( 2009) consider three models: Model 0 ("level shift" or "crash"), Model I ("slope change" or "changing growth"), and Model II ("mixed change").
First, for Spanish net foreign assets divided by GDP, we use Model I, which allows for the effect of a structural break on the slope of the time trend.The results of applying the Carrion-i-Silvestre-Kim-Perron tests are shown in Table 2, for up to one or two breaks, respectively.As Table 2 shows, the null hypothesis of a unit root with one or two structural breaks-that affects the slope of the time trend of the time series-cannot be rejected by any of the tests at the 5% level of significance.Consequently, we can conclude that the nfa t series could be I(1) with one single or two different structural breaks.The first is located in 1993 or 1994, which is mainly related to the start of the boom-bust cycle of the Spanish economy in 1994-2007, and the second structural break is located in 2011, which is associated with the deep economic recession of 2008-2013 in the aftermath of the international financial crisis of 2007-2008.
Second, for the Spanish current account balance divided by GDP, we use Model II, which allows for the effect of a structural break on the intercept and the slope of the time trend.The results of the Carrion-i-Silvestre-Kim-Perron tests are shown in Table 2, allowing up to three breaks.As Table 2 shows, the null hypothesis of a unit root with three structural breaks that affect the intercept and the slope of the time trend of the time series cannot be rejected by any of the tests at the 5% level of significance.Consequently, we can conclude that the nx t series could are I(1) with three different structural breaks.
The first corresponds to 1974, which is related with the first oil price shock of the 1970s.This break date identifies a clear negative "crash" in the current account balance as a consequence of the 1973 oil price shock with a Spanish economy highly dependent on energy imports and with low level of energy efficiency.As a consequence, the ratio of the current-account deficit to GDP gradually worsened: from +0.8% in 1973 to −4.3% in 1976.The second structural break occurred in 1994, associated with the boom cycle of the Spanish economy in the period 1994-2007.This break date identifies a clear negative slope change in the current account balance.Thus, the ratio of the current-account balance to the GDP gradually worsened, from −2% in 1993 to −9.4% in 2007 (its historical peak).Finally, the third structural break date is 2007.Here, the test detected a positive slope change in the current account balance divided by GDP.The change is such that negative current-account balance gradually bettered: from −9.4% in 2007 to a surplus of +0.1% in 2012.This positive shock was due the effects of the persistent slump in Spanish real activity after the global financial crisis of 2007-2008.In the second step of our analysis, we conducted a real-time bubble monitoring exercise for both series, to address the Spain's debt sustainability problem.The methodology developed in PWY and PSY was originally proposed to test for recurrent explosive behavior for the U.S. stock market.In this article, we use the methodology developed in PWY and PSY to examine whether the ratio of Spanish net foreign assets to GDP and the ratio of Spanish current account balance to GDP had bubble behavior at any point time of the sample period.
For our empirical application, the lag order K is selected by the Bayesian information criterion (BIC) with a maximum lag order of 4, as suggested by Campbell and Perron (1991).We set the smallest window size according to the rule r 0 = 0.01 + 1.8∕

√
T recommended by PSY, giving the minimal length of a subsample at 12 years.The origination (termination) of an explosive episode is defined as the first chronological observation whose test statistic exceeds (goes below) its corresponding critical value.First, Table 3 reports the SADF and GSADF tests of the null hypothesis of a unit root against the alternative of an explosive root in both series.We conducted a Monte Carlo simulation with 2000 replications to generate the SADF and GSADF sequences of statistics and the corresponding critical values at the 10%, 5%, and 1% levels.As can be seen in Table 3, we reject the unit root null hypothesis in favor of the explosive alternative at the 1 % significance level for SADF and GSADF tests for nfa t .On the contrary, none of the tests exceed their respective right-tail critical values of 10%, 5% and 1% for nx t .
Next, we conducted a real-time bubble monitoring exercise using the PSY strategy.As noted in Phillips andShi (2017, 2018), the PSY procedure also has the ability to identify, in our case, external adjustments.
To locate the origin and the conclusion of the explosive behavior of external debt and the external adjustments episodes, Figure 3  full sample).Figure 3 identifies explosive episodes and allows to date-stamp their origination and termination, as well as the potential external adjustments.We also conducted a real-time bubble monitoring exercise using the PWY strategy.Figure 4 plots the SADF statistic against the corresponding 99% and 95% critical value sequences.According to Figures 3 and 4 For the ratio of Spanish current account balance to GDP, the empirical results of the sequential PSY and PWY are shown in Figures 5 and 6, respectively.In Figure 5, the period of speculative bubble behavior identified is precisely the same as that of the ratio of Spanish net foreign assets to GDP (see Figure 3) although with a shorter duration (2005)(2006)(2007).The GSADF statistic sequence only exceeds the corresponding 95% critical value, but not the corresponding 99% critical value.Moreover, from Figure 6, the SADF statistic sequence does not identify any episode of explosive behavior for this time series.
Consequently, we can conclude that there is some evidence of bubbles in the ratio of Spanish net foreign assets to GDP.On the contrary, the evidence that the ratio of the Spanish current account balance to GDP had explosive subperiods is very weak.

CONCLUSIONS
In this article, we presented the results of a real-time bubble monitoring exercise for the ratio of Spanish net foreign assets to GDP, so as to address the issue of the sustainability of Spain's external debt.
The Spanish case can be of interest given since it has experienced current account deficits in 63% of the years of our sample period.This article aimed to address the issue of the sustainability of Spain's external debt, using data for the period 1970-2020.To detect episodes of potentially explosive behavior of the ratio of Spanish net foreign assets to GDP and the ratio of current account balance to GDP, and also episodes of external adjustments during this long period, we employed the recursive unit root test approach proposed by (Phillips et al., 2011;Phillips et al., 2014), and (Phillips et al., 2015a,b).
From our empirical analysis, we can conclude that there is some evidence of bubbles in the ratio of Spanish net foreign assets to GDP.On the contrary, the evidence that the ratio of the Spanish current account balance to GDP had explosive subperiods is very weak.
The identified episode of explosive behavior in the position of net foreign assets occurs in the period 2002-2015, as a consequence of the expansion of the Spanish economy in the period 1995-2007.In particular, tests indicate that the explosive behavior started in 2002 and ended in 2007, with the onset of the international financial crisis of 2007-2008.The results also show that there was an external adjustment during the period 2008-2019, after the start of a cyclical economic recession.But in 2020, as a result of the COVID-19 pandemic, and the decrease in the current account surplus (only up to +0.7% as a percentage of GDP), the ratio of net foreign assets to GDP again increased up to −84.4%.
The identified period of speculative bubble behavior in the ratio of the Spanish current account balance to GDP is precisely the same as that of the ratio of Spanish net foreign assets to GDP although with a shorter duration (2005)(2006)(2007).
The ratio of the current account balance to GDP of the Spanish economy could deteriorate again due to temporary and structural factors, as has happened historically.
Notable among the temporary factors is the role of the business cycle.The beginning of another period of vigorous domestic demand in 2021 means that the imports of goods rise and the exports of goods fall, which will harm the trade balance, and therefore the current account balance.The European Commission is optimistic about the expansion of economic activity, and expects that it should pick up strongly in 2021-2022, with a real growth of GDP of +5.9% in 2021 and +6.8% in 2022. 11Among the long-term factors (or non-cyclical factors) that could also contribute to the deterioration of the external balance, the negative and important budgetary consequences of the recent economic crisis triggered by COVID-19 in 2020 stand out.
The still high ratio of external debt to GDP and the large and negative ratio of negative net foreign assets to GDP constitute one of the main vulnerabilities of the Spanish economy.First, reducing the ratio of the Spanish net foreign assets to GDP to less vulnerable levels will require having large and persistent current account surpluses over a long period of time, and also require maintaining high growth rates and low interest rates.Second, achieving external surpluses on a sustained basis will also require healthy public finances and stronger ongoing gains in the competitiveness of the economy.This would require both structurally sounder public finances and more significant reforms in the factor and product markets so that the gains in external competitiveness of recent years can be maintained and put on a firmer basis. 12 14679396, 2023, 1, Downloaded from https://onlinelibrary.wiley.com/doi/10.1111/roie.12611 by Universitat De Valencia, Wiley Online Library on [21/03/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License

F
Spanish net foreign assets over GDP ratio (%) 1970-2020 [Colour figure can be viewed at wileyonlinelibrary.com]

F
Spanish current account balance over GDP ratio (%) 1970-2020 [Colour figure can be viewed at wileyonlinelibrary.com]

F
I G U R E 4 Date-stamping periods in the Spanish net foreign assets over GDP ratio: The SADF test [Colour figure can be viewed at wileyonlinelibrary.com] plots, for the ratio of Spanish net foreign assets to GDP, the GSADF statistics sequence against its 99% and 95% corresponding critical values sequences.The initial start-up sample for the recursive regression covers the period 1970-1981 (25% of the F I G U R E 5 Date-stamping bubble periods in the Spanish current account balance over GDP ratio: The GSADF test [Colour figure can be viewed at wileyonlinelibrary.com] , there is a clear speculative bubble behavior in the position of the net foreign assets in the period 2002-2015, as a consequence of the expansion of the Spanish economy 1995-2007.In particular, the tests indicate that explosive behavior begins in 2002 and ended in 2007, with the onset of the international financial crisis of 2007-2008.Figures 3 and 4 also show the external adjustment in the 2009-2019 period, after the beginning of a cyclical economic recession.

F
I G U R E 6 Date-stamping bubble periods in the Spanish current account balance over GDP ratio: The SADF test [Colour figure can be viewed at wileyonlinelibrary.com] 14679396, 2023, 1, Downloaded from https://onlinelibrary.wiley.com/doi/10.1111/roie.12611 by Universitat De Valencia, Wiley Online Library on [21/03/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License 14679396, 2023, 1, Downloaded from https://onlinelibrary.wiley.com/doi/10.1111/roie.12611 by Universitat De Valencia, Wiley Online Library on [21/03/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License 14679396, 2023, 1, Downloaded from https://onlinelibrary.wiley.com/doi/10.1111/roie.12611 by Universitat De Valencia, Wiley Online Library on [21/03/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License M unit root tests with multiple structural breaks from Carrion-i-Silvestre et al. (2009) a,b,c T A B L E 2 Superscripts 1,2,3 indicate significance at the 10%, 5%, and 1% levels, respectively.Data stamping bubble periods in the Spanish net foreign assets over GDP ratio: The GSADF test [Colour figure can be viewed at wileyonlinelibrary.com] Note:F I G U R E 3