The crisis of the Spanish economy

This article offers a narrative of the Spanish crisis building upon previous literature and the papers published in this issue. This narrative focuses on two main topics: (1) the reasons why the Spanish economy embarked in the expansionary/speculative path resulting in an over-accumulation of debt and severe macroeconomic imbalances that led to the crisis, and (2) the factors that explain why the Spanish crisis materialized with such a high intensity and duration. The article addresses them by highlighting three main characteristics of the Spanish economy in the pre-crisis period: (1) a composition of economic activity increasingly biased towards construction, real state, and other non-tradeable sectors, (2) a banking system that was able to satisfy the huge increase in credit demand arising from households and firms, in a context of very low real interest rates, excessive optimism about growth, and large facilities for using real assets as loan collateral, and (3) the recourse to external funding that originated an unprecedented increase in liabilities with respect to the rest of the world.


Introduction
The story of the recent economic crisis in Spain has been told many times and in many different versions. Yet, as time goes by, economic research is showing new elements of its nature and its protractedness. Thus, the editors of SERIEs decided to devote a monographic issue to the analysis of different aspects of the impact of the great recession on the Spanish economy. As guest editors, we had the opportunity to look closely at a new vintage of papers on the performance of the Spanish economy during the last years. In this introductory article we offer our narrative of the crisis, which is, in part, based upon our readings of these papers and of the relevant previous literature, and, in part, on informed conjectures about the main cyclical factors and long-run trends that conditioned such a performance.
The Spanish variety of the so-called great recession is indeed a multi-faceted crisis, with the financial system, the public sector, households, and the corporate sector all together at the forefront of its origin and involved in its evolving process. Some of the main developments that eventually led to the crisis are well-known and have been analyzed elsewhere [see, for instance, Estrada et al. (2009), the set of papers collected in FEDEA (2010), Suárez (2010) and Ortega and Peñalosa (2012)]. However, there are still two essential elements that, in our view, are less well understood. The first one has to do with the factors that made the Spanish economy especially prone to embark in the expansionary/speculative path resulting in an over-accumulation of debt and severe macroeconomic imbalances that led eventually to a crisis. The second is about the factors that explain why the crisis materialized with intensity and some characteristics different to the consequences of the great recession in other countries, including the role that economic policies may have played at generating these peculiarities.
To answer these questions, it is important to understand three main characteristics of the Spanish economy during the pre-crisis period: 1. A composition of economic activity increasingly biased towards construction, real state, and other non-tradeable sectors. To a large extent, this bias was the result of (1) a labor market regulation that strongly favors the creation of temporary and seasonal jobs, (2) a housing market that, after its liberalization in the early 2000s, provided wide scope for demand and supply to expand significantly, and (3) product and labor markets that, being poorly regulated, do not promote the creation and growth of new firms in the tradeable sector. All these together eventually conformed a "dual economy", with some large firms highly productive and competitive in international markets, and a large number of small and medium sized firms with low productivity and low growth potential. 2. A banking system capable of satisfying the huge increase in credit demand from households and firms, in a context of very low real interest rates, excessive optimism about growth, and lax facilities for using real assets as loan collateral, thus creating the landscape for financial instability when these real assets lost value. 3. The recourse to external funding to sustain the rise of credit that led to an unprecedented increase in liabilities with respect to the rest of the world, and the lack of anticipation by policy-makers, both with national and international responsibilities, of the consequences of excessive accumulation of external debt.
Accordingly, we organize the paper in three main sections, one per each of the factors to be stressed: the weakness of the growth model underlying the performance of the Spanish economy in the pre-crisis period, the consequences of the banking intermediation in a speculative bubble, and the implications of the external disequilibrium. We conclude with some remarks about what has been achieved so far in the correction of these phenomena and what remains to be done.
2 The "fundamentals": product and labor markets, and the growth model When financial markets started to show some signs of distress in August 2007, the conventional view was that the Spanish economy had "solid fundamentals" and, despite the high debt and the imbalances accumulated during the pre-crisis period, it was resilient enough to the international financial shocks that back then were thought to be the sources of the economic slowdown. This confidence was however built on factors that eventually resulted to be either inexistent or insufficient: (1) a fiscal surplus and low public debt that would supposedly provide wide scope for countercyclical demand policies; (2) reasonably flexible product and labor markets that would allow to gradually and smoothly unwind the excesses of the past and other macroeconomic imbalances, and (3) a banking system with large capital buffers and supposedly protected of the US subprime crisis that originated the early financial turmoil (to be discussed in Sect. 3). This conventional view, shared by many economic commentators, the Spanish Government of the times, and some international organizations, was based on the traditional paradigm under which exogenous shocks are at the origin of economic fluctuations, on the confidence in countercyclical demand policies to smooth slowdowns in economic activity, and on the belief that the Spanish labor and product markets, after a sequence of reforms in the 1990s and early 2000s and the large influx of immigrants, were flexible enough to accommodate a recession without significant losses in production capabilities. An alternative view was skeptical both about the benign interpretation of the implications of the financial crisis, and about the supposedly strong fundamentals of the Spanish economy. This view stressed that the Spanish economy was very dependent on external financing and, therefore, very likely to suffer a sudden stop as soon as the favorable international financial conditions worsened, that the very high levels of private debt were only sustainable with unending increases in housing prices and higher productivity growth, and that reforms of the product and labor reforms, together with the easy access to credit, had created a allocation of resources very much biased towards non-tradeables, and, specially, towards the construction and the real estate sectors. Other sources of concern were that macro policies (monetary and fiscal) were deemed to have been not sufficiently countercyclical during the expansion, so that during the crisis they were bound to be constrained, that changes of the regulation of product and labor markets were not properly evaluated and, that, after the initial signs of an economic slowdown, neither macro nor micro polices seemed to react with promptness and guided by a correct diagnostic of the situation. In fact, the expansionary fiscal response in 2008-2009 was misguided and very counterproductive, as it exhausted any scope for expansionary fiscal policies when they were eventually more needed.
As a result, some observers perceived that the correction of the external imbalances was bound to be very difficult and potentially abrupt, especially given the gloomy growth forecasts and the inability to appeal to exchange-rate devaluations as an adjustment mechanism. In sum then, the Spanish economy was about to suffer, not a mild slowdown somehow smoothed out by demand policies, but a long and protracted period of adjustment punctuated by periods of severe financial distress. Indeed, under this view, since the problem was the unsustainable financial position of the private sector, the adjustment was unavoidable, and would have taken place even without the US subprime crisis or some other developments affecting negatively to the global economy.
Nowadays, these two alternative views of the crisis still receive much attention. Caruana (2014) has labeled them the "shortfall of demand view" and the "balance sheet view", and, after considering evidence and deriving the policy prescriptions that would follow from each one of these two views, concludes that the latter seems to provide a better explanation of the crisis overall, although, in his opinion, "the diagnosis has to be country-specific" (sic).
Thus, turning more deeply into the Spanish case, in this Section we lay out a first component of the answers to two questions: (1) What made the Spanish economy so prone to suffer the speculative boom of the 1995-2007? and (2) Where were the main sources of that speculative boom?

Labor market institutions and the composition of production
During the pre-crisis period the Spanish economy developed some characteristics that made it especially prone for a housing bubble. The two most relevant ones were a banking sector that was capable of capturing external funding to transform it into mortgage credit; and a construction sector, which after the large infrastructure investments of the 1980s and 1990s, supported partially by European structural funds, had enough capacity to expand and deliver an increasing influx of new houses and infrastructure works. Demographics trends-immigration and emancipation of the late baby boomers-provided a further boost to housing demand, which was expanded by a very favorable tax treatment of house ownership, and by the traditional way of financing self-employment and small businesses through the use of real assets as loan collateral. Ironically, these two strengths nurtured a housing bubble, and once the process started, it gained momentum, sustained by strong feed-back effects. For instance, changes in banking and land regulations provided further impulse to the speculative housing boom. These changes were not always in anticipation of the negative consequences of the speculative process, which, as shown by Fernandez-Villaverde et al. (2013) and Santos (2014), provided incentives for the generation of financial assets of not very good quality, complicated monitoring and policy evaluation, and facilitated the entrenchment of interest groups and lead to a deterioration of governance institutions.
Some of these negative political economy effects were notoriously felt in the poor regulation of the labor market. By allowing for temporary and fixed-term contracts under, de facto, a wide array of conditions, this regulation favored seasonal activities and the creation of short-duration jobs, very prevalent in the construction sector, but a the cost of promoting very inefficient job turnover in the rest of the sectors. In general, labor market regulations are the result of a political process in which both efficiency and equity considerations are taken into account (Bertola 2014). However, it happens very often that these regulations are tailored out to fit the peculiarities of the economic structure of a given country, for instance, with a dual employment protection legislation (allowing for fixed-term, temporary contracts, besides the regular, open-ended employment contract) to lower the hiring and firing costs of sectors with presumably high job turnover (tourism, construction, etc.) This strategy fails to realize that, by doing so, jobs, in that sector but also elsewhere, will be predominantly created under the schemes most favored by the legislation (fixed-term, temporary contracts). Therefore, and as basic economic textbooks show, what a country produces and how does it, are determined not only by endowments of physical and human capital relative to the rest of the world, but also by labor and product market regulations.
Hence, the sectoral composition of production is not an exogenously given constraint that produces a particular mix of employment contracts. It is the availability of temporary employment contracts (among other factors) what influences the sectoral and occupational composition of employment, how many jobs are created and destroyed, and, last but not least, which socio-demographic groups are more likely to be hired and fired.
Another particularly important consequence of product and labor markets regulation was to be felt in productivity developments. Since the early 1980s the Spanish economy enjoyed a huge increase of physical and human capital. However, during the period 1995-2007 labor productivity and TFP growth rates were, in annual averages, 0.7 and 0.0 %, respectively. This was also the period in which the unemployment rate came down from almost 20 % in 1994 to around 8 % in 2007. At those times, many commentators and international organizations praised the liberalization of the Spanish labor market, for paving the way for high employment growth and causing the huge reduction in unemployment. But others (see, for instance, Bentolila and Jimeno 2006) remained unconvinced about the advantages of increasing flexibility a the labor market by creating a dual structure with a high prevalence of fixed-term contracts, while at the same time maintaining a wage setting system that protected insiders with real wage rigidities, and expressed concerns about the sustainability of low unemployment rates once the extraordinary macroeconomic conditions of the times changed. There were also concerns about how the Spanish labor market was reacting to long trends in the world economy, such as skill-biased technological progress, globalization, and increasing migration.
The paper by Anghel et al. (2014) on employment polarization is especially relevant in this regard. It focuses on changes in the occupational employment shares, highlighting how during the period 1997-2012 several socio-demographic groups adapted to those changes. As it has also been shown in other countries, they find a decline in the share of occupations involved in routine tasks, and a rise of those with non-routine service contents, both at the low and the high tails of the wage distribution, while jobs with a higher degree of abstract contents do not appear to increase their share in total employment during these 15 years. Four other findings are worth highlighting: (1) these developments are not only the consequence of the sectoral reallocation of employment, associated to the increasing weights of the construction and non-tradeables sectors, since they took place within almost all the industrial sectors, (2) this trend accelerated during the great recession, (3) affected males and young workers more strongly than to females and old workers, because of higher concentration of the latter in occupations more focused on routine tasks, and (4) changes in the composition of labor supply by educational attainments cannot explain the increase in the share of occupations at the low end of the wage distribution. Although employment polarization of this type is typically thought to be associated to skill-biased technological progress (see Autor and Dorn 2013), Anghel, de la Rica and Lacuesta show that the response of the Spanish labor market to this phenomenon displays important peculiarities that seem consistent with a segmented labor market offering low opportunities to stable, high value added jobs, and displaying inefficient job turnover.

Wage and employment dynamics
The institutional configuration of the Spanish labor market did not only contribute to the housing bubble and the concentration of resources into non-tradeables. It also explains wage and employment dynamics during the crisis, with wages initially displaying a strong downwards rigidity, and a large share of employment losses coming from employees under fixed-term contracts.
Two of the papers in this issue focus on wage determination in the Spanish labor market. First, De la Roca (2014) uses longitudinal data from the Social Security registers to gauge the degree of cyclicality of real wages in Spain throughout the period 1988-2011. He does so by, first, estimating the net present value of wages in new matches to show that it is well approximated by the cyclicality of wages for newly hired workers, more than 95 % of them under fixed-term/temporary contracts. Secondly, he highlights that this margin of wage adjustment is the main one under the Spanish wage determination system, given the constraints imposed by collective bargaining legislation. Finally, despite that margin of flexibility and the finding that the response of wages of workers under temporary contracts is twice as large for workers under permanent contracts, de la Roca estimates that the response of wages to a 1 % decline in the (lagged) unemployment rate is about 0.4 %, which is the lowest among available estimates for other developed countries (between 1.3 and 1.5 % in the US and between 2.0-2.2 % in European countries). Thus, as expected, institutions that make difficult for firms to respond to business cycle fluctuations deliver a much higher degree of wage rigidity, and it is wage rigidity, together with the prevalence of temporary contracts, what explains the huge employment losses registered in the Spanish economy during 2007-2009, in contrast with the small changes in employment in other countries where labor market regulations were more conducive to changes in working hours, labor hoarding, and wage adjustments (see Casado et al. 2014).
The second paper on wage and employment dynamics is by Sala and Trivin (2014). They study why employment fluctuations in the Spanish labor market are so volatile, by applying (Blanchard and Katz 1992) methodology to estimate how unemployment, participation, migration flows, and prices react to regional employment shocks. They confirm previous results in this literature (see, for instance, Bentolila and Jimeno 1998): changes in participation rates are the main adjustment mechanism in expansion, while unemployment and labor mobility are more important during recessions, with migration flows being larger in high-unemployment regions. The estimation of the differential importance of the three variables during expansions and recessions, the consideration of the response of prices to labor demand shocks, and the additional disaggregation by two groups of regions (one including Catalonia, Madrid, Navarra, and the Basque Country, and the other one grouping the rest of the regions) are the main contributions of the paper. Regarding prices, the main finding is, once more, that strong real wage rigidities, arising from the determination of nominal wages and consumer prices, are present both in expansions and in recessions.

The banking sector
As mentioned we are interested in understanding what made Spain particularly prone to speculative cycles. An important factor in this regard is the existence of a large and competitive banking sector, ready to intermediate and direct the enormous amount of funds that were needed to finance the boom in consumption and investment taking place in Spain during the first decade of the euro. The Spanish banking system in the eve of the euro had witnessed a remarkable transformation for over a decade. First, it experienced a remarkable process of consolidation during the years that followed accession to the European institutions. In addition some of the resulting entities became, through a bold acquisition strategy, global banks, so that Spain had financial institutions with balance sheets that were large when compared to the size of the Spanish economy. Second, legal changes in the second half of the 1980s had made the Cajas, the Spanish equivalents of savings and loans, into a new dynamic player in the Spanish credit market, by converting them into banks in all respects but name, with one very crucial exception: their governance structure. They were private entities without the governance structure one typically associates with private firms: a shareholder structure with both economic and political rights that is represented in a board empowered to monitor and discipline management. Instead legal changes enshrined the principle of local political representation, so that both municipal and regional authorities became amply represented in the governance bodies of the Cajas. In addition regional authorities had broad powers to alter the legal framework under which they operated. Predictably, the result was the capture of these institutions by the local political elites (Santos (2014), offers a thorough account of these developments). This had consequences for both the evolution of the real estate bubble as well as for the management of the crisis.
In sum, by the mid nineties, in the eve of the monetary union, the Spanish banking sector had turned the corner on a second banking crisis, was well in a process of consolidation, and featured a new dynamic player in the Cajas. In addition the Bank of Spain had retooled itself and gained considerable experience in the handling of systemic banking crises after having coped with two in the span of barely 20 years. It had as well introduced several innovations, such as the dynamic provisioning system, that led many observers to think that the banking system had enough safeguards against any imbalances building in the economy.
But the imbalance, the real estate and construction boom that Spain experienced between the late 1990s and 2007, was larger than envisaged. The exposure of Spanish banks and Cajas to the real estate sector increased considerably during this period. Figure 1 shows the real estate exposure, defined as the sum of mortgage loans and loans for housing renovations, loans to real estate developers and loans to construction 1993Q3 Credit Institutions Banks Cajas companies, for the banks, Cajas, and the credit institutions overall. It went from 32.7 % in 1992Q4 to 62 % of the loan portfolio to firms and households in the eve of the crisis. The Cajas had considerably more exposure than the banks, and at the peak real estate loans comprised 70 % of the entire loan portfolio. This estimate is likely to underestimate the extent of the exposure of financial institutions to the real estate sector as it does not include items such as equity stakes banks and Cajas had in real estate developer and construction companies, as well as loans to hotels, which are likely to be closely linked to the situation in the real estate sector. Thus, the sensitivity of the asset side of the balance sheet to a housing price correction was enormous. Given the size in GDP terms of the accumulation of real estate risks in the balance sheet of credit institutions, the potential risks were systemic. At the peak the mortgage portfolio was above e600bn or slightly below 60 % of Spain's annual GDP in 2007. And, moreover, real estate bubbles are typically associated with loosening of the lending standards. For instance Keys et al. (2013) document that the real estate bubble in the US was accompanied by a strong increase in no-documentation subprime loans, mortgages with an incomplete set of documents. Prior to 2000, fewer than 20 % of new subprime loans were originated with low or no documentation. By 2006, as lenders became to rely increasingly in noisy FICO scores and LTVs as sufficient statistics for the quality of the borrower, this figure approached a full 50 % of new subprime originations. In addition these authors note that there is substantial empirical evidence that the liquidity of the loan, i.e. the ability to securitize the loan and pass through the risk to third parties, decreases the incentives to screen borrowers.
The paper by Akin et al. (2014), argues that the mechanism at work in Spain was rather different due to the fact that the securitization was less of factor in the Spanish case. They identify the precise channels that link the credit and real estate boom and the deterioration of lending standards throughout this period, and show the presence of a rather different mechanism than the one at work in the US. They have access to a data set that allows them to observe unique characteristics of both borrowers and lenders as well as appraisal values and, for a subset of the sample, market prices. The results illuminate some interesting patterns concerning lending standards during the boom and bust periods. For instance workers with temporal contracts received during the boom mortgages with LTVs that were economically and statistically identical to the mortgages received by permanent workers, though the former were more exposed than the latter to the inevitable adjustment in the real estate sector and thus more likely to be unemployed. In addition, during the real estate boom employed and non employed borrowers paid the same loan spreads. All these effects get undone during the bust. They conclude that the lending standards during the boom were excessively soft.
In addition the nature of their dataset allows them to explore the differences in lending behavior between banks and Cajas. They find that credit institutions that were rescued at some point or another of the crisis by the Spanish authorities, all of them Cajas, granted mortgages with the highest LTVs. An important contribution of their work is to show evidence on how banks and Cajas circumvented restrictions on LTVs that were put in place precisely to avoid the excessive risk taking behavior during the real estate boom. Unlike the US where agency issues related with the securitization standards are behind the loosening of the lending standards, in Spain appraisal companies were encouraged by their owners (the banks and Cajas), which were also their clients, to inflate their estimates of value and thus reduce the LTVs to facilitate compliance with Bank of Spain standards.
An important question is whether the accumulation of real estate risks in the balance sheet of the Spanish banks and Cajas led to constraints in lending during the bust. This is a key policy question as the cost of an speculative credit cycle is not only the misallocation of capital during the boom, but also the likely credit crunch that follows when the bust comes as the banks try to replenish their capital buffers. Hernando and Villanueva (2014) explore this channel and find that lagged exposure to real estate (and the interaction with housing prices) is a good predictor of financial institutions' capital growth once housing prices had accumulated two years of negative growth. The lag in the effect is an interesting finding and speaks to the issue of the effectiveness of dynamic loan provisioning in Spain. As they note, it may be likely that initial housing price drops were absorbed by existing provisions and thus capital growth did not react to the losses at the beginning of the recession, though the NPL ratio was growing steadily.
In addition they find that lagged exposure to real estate only predicts NPL growth in the real estate sector. This suggests that credit institutions exposed to real state were not lending to worse quality firms: The drop in mortgage lending standards identified by Akin et al. (2014) does not seem to extend to firms outside the real estate sector. Another important consideration is about the connections between the credit and capital growth. Hernando and Villanueva (2014) find though that this channel can only explain a small fraction of the credit collapse, which suggests that demand factors are also to blame for the large drop in credit activity.
The counterpart to the mortgages and loans in the banks balance sheets are of course the liabilities of households and firms. There are important welfare conse-quences associated with household debt; in particular, low income households may face severe pressure to meet commitments in an environment with high unemployment and low income growth. In the case of firms, debt overhang may have important negative consequences for investment and thus employment creation. Bankruptcy is of course an important deleveraging mechanism. The paper by García-Posada and Mora-Sanguinetti (2014) is concerned with the efficiency of Spain's bankruptcy law. Their starting observation is that businesses in Spain rarely file for bankruptcy. The reason is that, as it is well known, the size distribution of firms in Spain is biased towards smaller ones, which have very low filing rates when compared to larger firms. The reason, these authors argue, is that Spain's bankruptcy code entails significant fixed costs, for both firms and creditors, which of course hurt smaller firms proportionally more. García-Posada and Mora-Sanguinetti (2014) show that Spanish small firms react to these larger costs by raising finance through mortgage loans, which in case of adverse business performance leads to foreclosure and asset repossession.
The question of the optimality of the bankruptcy code is key, in particular for a country in a monetary union, where the possibility of nominal adjustment is essentially precluded. Indeed, institutional flexibility and rapid adjustment of balance sheets seems a precondition in a monetary union with limited transfers amongst member nations. An important feature of the paper by García-Posada and Mora-Sanguinetti (2014) is that it emphasizes the need to deepen our understanding of the ex-ante consequences in terms of the capital structure of poorly designed institutions and the ex-post costs of slow adjustment in the case of debt overhang.
These studies provide a window onto the nature of the asset quality problems accumulating in the Spanish banking system, but there were fragilities as well in the liability side of the balance sheets, in particular some that were a new feature in this banking crisis when compared with the two previous one Spain had experienced since the mid 1970s. Specifically, throughout this period retail deposits funded a decreasing fraction of the loan portfolio and this, of course, increased the fragility of the Spanish banking system. Two are the reasons for this increased fragility. First much of whole sale funding is short term and reacts quickly to whatever concerns there are on the quality of the issuer; instead retail deposits are notoriously sticky and slow to react, safe under the deposit insurance umbrella. Second, much of this funding was supplied by foreigners. Indeed as the next section shows a remarkable feature of the Spanish crisis is that it had characteristics that were strikingly similar to those of foreign currency crises experienced by some developing economies over the last three decades. In particular, the dramatic events of 2011 and 2012 were reminiscent of the sudden stops experienced by countries with large external liabilities denominated in foreign currencies. The performance of Spain's external sector during the early years of the euro is a critical ingredient to understand the dynamics of the crisis.
of 10 % of GDP in 2007. These large and sustained deficits translated into strong external liabilities over time.
There are two ways to interpret these external imbalances. First, deficits can be seen as the result of a strong expansion of internal demand that, in the Spanish case, came from consumption and investment: the enormous growth in real estate activities, and other investment, as well as domestic consumption were well above domestic savings and thus the large current account deficits. The starting point of this analysis is that international capital flows are determined by the cross sectional dispersion in the marginal productivity of capital and, also, the need to smooth out business cycle shocks. Hence, the main determinants of the foreign position are developments in the real side of the economy.
A second view focuses instead on the autonomous factors driving international capital flows that are not merely those implied by changes in the real economy. This view (Bernanke 2005) emphasizes, for example, that international capital flows are the results of savings gluts in countries such as Germany and China, being recycled in claims in countries such as Spain and the United States. Under this approach, international capital flows searching for yield were the main source of speculative dynamics in the countries recipient of these capital flows, and, hence, banking crises are connected to the foreign sector developments. Indeed Borio and Disyatat (2011) note that the since the late 1990s there has been a remarkable growth in gross international flows (the sum of inflows and outflows), larger than the corresponding current account positions (net capital flows). Importantly, this growth is driven to a large extent by an intensification of capital flows among developed nations. All these observations suggest that it is perhaps more useful to focus on international capital flows, rather than on traditional drivers of current account dynamics.
It is indeed the case that Spain has been traditionally a country deprived of capital and thus with a high marginal productivity of capital. The reluctance of investors to hold assets denominated in pesetas, the old Spanish currency, and the reluctance of Spanish counterparties to issue liabilities in foreign currencies limited the size of Spain's external imbalances. In addition, whenever Spain's imbalances grew, devaluations within the context of the European monetary system, served as the main correction mechanism.
The monetary union by removing exchange rate risk, allowed for the possibility of large external imbalances to develop and indeed the size of foreign capital flows into Spain was unprecedented. Two pieces of evidence on this will serve to make the point. First the Memoria de Supervisión Bancaria for the years 2003-2007 reports the volume of the Spanish securitizations in the hands of foreigners. As it is well known Spanish securitizations came in two types, the standard one in other jurisdictions which involves transfer of the underlying asset to a special purpose vehicle funded through the issuance of liabilities with waterfall structures, and a second one akin to a securitization of a liability, a single-certificate privately placed covered bond (cédulas hipotecarias). As reported by these Memorias the stock of both types of securitization was slightly above e300bn by 2007. Of these more than e200bn were in the hands of foreigners. This evidence is important because it confirms the existence of a direct link between international capital flows and the real estate bubble. To gauge the origin of these international capital flows we turn to the BIS statistics. Figure 2 displays foreign claims of reporting banks on counterparties in Spain, which is safe to assume are mostly banks. For instance, German reporting banks more than doubled their claims on Spanish counterparties between 2005 and 2008, from slightly above $120bn in 2005Q1 to $315bn in 2008Q1, an increase of more than 160 % in 3 years. As the figure shows this pattern is repeated across the main countries in the Eurozone as well as some of the main economies outside the euro.
Spain was indeed the recipient of large capital flows from other developed nations and was soon to found itself with unprecedented liabilities to the rest of the world. Many disputed the importance of this for after all what is the sense in talking about the current account deficit that the state of Alabama has with respect to the state of New York? The difference of course in the "monetary unions" of the USA and the Eurozone is that the first has a system of transfers as well as a population mobility that are missing in the second. Transfers, mostly mechanical in nature in the form of unemployment insurance, smooth out the adjustment when it comes, and population mobility serves to alleviate unemployment and the accompanying social problems. Though there is some population mobility in the form of emigration none of these mechanisms are at work in Europe to the extent that they are in the US. As a result when the correction came it would have to be met with real balance sheet adjustment and the limited fiscal support of national states, creating sovereign crises even in countries considered models of fiscal probity until then. The most acute phase of the crisis occurred when the possibility of exchange rate risk was reintroduced, something Eurozone member nations thought a thing of the past. Once that risk reopened the dynamics of the Eurozone crisis were similar to the twin crises model, when countries are afflicted by both fiscal and balance of payments problems. Figure 2 also illustrates the striking correction Spain was to suffer once the crisis hit. For instance German banks lowered their claims on Spanish counterparties precipitously, from the aforementioned peak of e315bn in 2008Q1 to e120bn in e2012Q4, the peak of the Spanish banking crisis. French banks lowered their exposure from e203bn to slightly above e100bn in the same period. This is thus a generalized pattern. All countries including those outside the euro lowered their exposure to Spain dramatically during the crisis. It is not surprising thus that given that many of these claims were liabilities that needed to refinanced Spanish banks became overly dependent on ECB funding.
Thus, Spain is another example of a global pattern; as Borio and Disyatat (2011) emphasize global current account imbalances (net capital flows) adjusted to a much lesser extent than gross capital flows. Indeed though Spain's current account imbalances started closing the moment the crisis hit foreigners redeemed their claims on Spanish counterparties much faster. Merler and Pisani-Ferry (2012) emphasize that the relevant accounting identity when considering the external position of a country in this crisis is CAB + PCI + SMP + PGM + T2 = 0, where CAB stands for the current account balance, PCI stands for the net private capital inflows, SMP for the securities market program by which the ECB purchases treasuries of the member nations, PGM are the official program transfers by the IMF and European mechanisms set for the purpose of directing official support to program countries and T2 stand for Target 2 positions. For the case of Spain the turnaround of international capital flows were compensated by an increase in T2 liabilities, which went from a position of no liabilities in 2007 to more than e400bn in August of 2012, the peak of the Spanish banking crisis. Once the credit line associated with the Memorandum of Understanding was drawn, the term PGM, a small amount compared to T2, gets activated.
It is indeed the case that Spain's largest trading partners are all other members of the Eurozone. Still to assess the performance of Spain's currency, the euro, Fig. 3 shows the dollar/euro exchange rate since the introduction of the euro in January 1999. Initially the euro depreciated on account of the economic troubles ailing the Eurozone's largest economy, Germany. Starting in 2002 though the euro appreciated considerably, a trend that was to last until the onset of the Great Recession. The appreciation of the euro forced Germany to a severe wage adjustment to maintain and increase its share of exports to important partners outside the Eurozone such as the United States, the United Kingdom and China, increasing its competitive advantage with respect to other Eurozone economies. In this Germany benefitted from labor market reforms in the early 1990s as well as from the Hartz reforms under Schroeder's chancellery. By 2007, the same year that Spain had a current account deficit of 10 % of GDP, Germany had a surplus of 7.5 %. Spain had thus the opposite of what is needed when there is strong accumulation of external liabilities: Its currency appreciated when what needed was depreciation.
In sum, Spain thus was the recipient of large capital inflows, flows that got reversed when the banking crisis worsened. An interesting open question is whether the presence of a large, dynamic banking system served to generate large international capital inflows and to amplify its effects. It is conceivable that these international capital flows  are supplied elastically to whatever banking system that can provide the safe assets that this international capital demands, whether be covered bonds or sovereign debt of a minimum rating. The banking system becomes fragile as a result, in particular if those inflows fuel a speculative cycle. When the cycle breaks the capital flows get reserved and what once were safe assets suddenly are found to load on common factors, such as national real estate prices, to which balance sheet of the lending banking systems are strongly exposed. But, was this inevitable? A country can be a large recipient of international capital inflows but these inflows can immediately be recycled into foreign assets. In this case net capital inflows are low but gross flows (inflows plus outflows) are very large. An important issue then is whether in the presence of large inflows policies that are consistent with free capital movements can be implemented to encourage capital outflows.
An interesting feature of the dynamics of large capital inflows is that during the run-up they push upwards estimates of potential GDP growth, which typically don't consider external imbalances as an input for their computation. This is important as the speculative cycle increases the collateral values of the securities backing up the claims issued by the banking system, which in turn fuels additional inflows, reinforcing the cycle. It follows that estimates of potential GDP should take into account external imbalances because these contain information regarding the sustainability of the expansion.
The paper by Alberola et al. (2014) deals precisely with the estimation of potential GDP when external imbalances are present. Specifically these authors argue that standards estimates of potential GDP growth rely exclusively on inflation as an indi-cator. Indeed prior to 2001 there was a strong positive correlation between growth and inflation, but not afterwards. It is for this reasons that estimates of potential growth were pushed upwards and perhaps led many foreign investors to keep directing funds to countries such as Spain. Alberola et al. (2014) first distinguish between standard measures of potential GDP growth and sustainable GDP growth, which is the maximum rate of growth that can be obtained without widening of imbalances such as current account imbalances. Building on this distinction they propose a new methodology to estimate sustainable growth rates, one that incorporates external imbalances as indicators as well as public and private imbalances. As it is intuitive, they find that sustainable growth rates during the years leading up to the crisis were below estimates of potential GDP growth, whereas the opposite is true during the crisis. In sum Alberola et al. (2014) propose a new measure that should be part of the variables to monitor when conducting stabilization policies, and, additionally, they can serve as early warning indicators of brewing crises.
The external sector thus is a key ingredient in the Spanish experience during the bubble years, one that deserves further study. Given the lack of monetary policy autonomy it seems that additional tools are needed to first monitor international capital flows, and, second, to guarantee that they do not translate into banking and financial instability. It is likely that new macroprudential tools may make it too costly for banks to intermediate these flows but alternative entities, such as asset managers or large non financial corporate, may serve as intermediation vehicles in future episodes. A world dominated by open international capital markets and a search for yield is one where the economic consequences of large capital flows are likely to remain important for the foreseeable future.

Concluding remarks
The image that comes across of the Spanish crisis, which is still ongoing, is that of a perfect storm: large international capital inflows were captured by a dynamic Spanish banking sector that was able to issue (apparently) safe assets that were backed explicitly and implicitly by a booming real estate sector. Two factors combined to produce the real estate boom needed to generate the assets and liabilities in the banks' balance sheets: (1) the presence in Spain of large civil engineering companies that could undertake the massive construction boom, and (2) a particular labor market structure that favors temporary employment contracts that first perfectly the strong seasonality of the construction sector. This complementarity is an important feature of the Spanish economy, one that needs to change if Spain is to find a different growth model. This process has left Spain with a massive debt overhang problem: as of 2014Q1 Spain's net international investment position is a negative trillion euros. This creates a binding constraint as it is difficult to see how Spain's traditional growth model based on expansion of the internal demand, which typically translates into a deteriorating current account balance, can be operational this time given Spain's limited capacity to add liabilities against the rest of the world. Given the obvious challenges associated with restructuring Spain's external (and internal) liabilities and the grim prospects of debt monetization, it seems that the country is heading towards a sustained period of current account surpluses through repression of internal demand, while a new growth model is put in place. Indeed, for the first time in more than three decades Spain had a positive current account balance in 2013.
It is also difficult to envisage a change in the growth model with the same strategy followed by structural reforms since the 1990s, and, in particular, during the crisis. Given the need to soften the external funding constraint and the likely continuing repression of internal demand derived from the long-lasting deleveraging process that, after accumulating so much debt, the public and private sector will have to undergo, permanently higher productivity growth in the tradeables sector seems a necessary condition for the macroeconomic imbalances accumulated during the crisis be gradually corrected. Typically, sustainable productivity growth is thought to be determined by the accumulation of capital, technological progress, and well-designed economic institutions providing the right incentives for agents to put production factors to their best use and to exploit all the opportunities brought up by technological progress. In particular human capital accumulation is a critical component and, therefore, improvements in the educational system are key from a long-run perspective. But additionally, how human capital is used in the labor market depends very much on labor markets institutions, and, thus, in countries with poor labor legislation, as it is notoriously the case of Spain, well-designed structural reforms can bring significant permanent increases in productivity growth even in the short-run. The elimination of the inefficient job turnover generated by dual employment protection legislation is one of the most obvious examples, but it is not certainly the only one.
Spain's economic future seems thus inextricably linked to the evolution of its external position and the progress of structural reforms. It remains to be seen whether Spain can finally adopt a new growth model, one based on strong current account surpluses, while simultaneously create the employment opportunities that would lead to a reduction of the unemployment rate. The legacy of the crisis is too intricate and complex to be easily solved, and sizeable challenges for the Spanish economy remain.
Open Access This article is distributed under the terms of the Creative Commons Attribution License which permits any use, distribution, and reproduction in any medium, provided the original author(s) and the source are credited.