The Drivers of Housing Cycles in Spain

Since Spain joined the EMU, two main important factors behind the housing boom appear to be the decrease of nominal interest rates and demographic factors. In this paper we estimate a New Keynesian model of a currency area, using data for Spain and the rest of the EMU to study the importance of those factors. We also examine the role of different rigidities and find that labor market frictions are crucial to explain main features of the data. On the other hand, financial frictions that impose a collateral constraint on borrowing do not appear to be relevant.


I. Introduction
The origins of the current global crisis are multiple and complex but, undoubtedly, the housing sector has played a central role in its amplification and propagation. Indeed, a recent paper by Leamer (2007) puts the housing sector at the center stage of most U.S. economic downturns. Reinhart and Rogoff (2009) have studied historical banking crises episodes and have showed their strong link, among other variables, to housing prices. Aspachs-Bracons (2009) has also studied the correlation of housing prices with main macroeconomic variables in an international context, and finds a significant relationship between economic downturns and housing price declines in a sample of 18 industrialized countries. Following a cumulative decline of housing prices of 23 percent in a five-year period, real GDP declines 1.5 percent in the following year, and the unemployment rate roughly doubles in 3 years. The importance of the housing sector comes from the central role it plays in the households' process to accumulate nonfinancial assets. Also, housing wealth can be used as a way to finance nondurable consumption. The housing spillovers to the rest of the economy have been studied by estimating the marginal propensity to consume out of housing wealth, either using reduced form regressions or structural models. 1 Therefore, understanding the causes and consequences of the housing cycle, and its implications for the broader economy and the appropiate policy response have become key in recent years, and the focus of attention of central banks and international institutions (IMF, 2008).
Given the widely recognized importance of this sector, it is not suprising that the most recent generation of dynamic stochastic general equilibrium (DSGE) models have been extended to incorporate a housing sector and all the economic effects associated to it. In a highly influential paper, Iacoviello (2005) extends an otherwise standard DSGE model to allow for durable (housing) consumption. In such a model housing plays a double role. First, it allows households to use their housing stock as a saving vehicle, in addition to providing instantaneous utility. Second, if a fraction of individuals face borrowing constraints, but financial markets allow them to borrow against their housing wealth, then monetary policy can have a stronger propagation mechanism. An expansionary monetary policy shock will lead to higher nondurable and durable consumption because of lower interest rates. Increased housing prices will increase the wealth of those who are long on housing, typically most households in the economy, boosting nondurable consumption even further. 2 Monacelli (2008) has stressed the role of this type of credit frictions to help explain several features of the data, most importantly the comovement between residential investment and private consumption to a monetary policy shock. Despite the strong propagation mechanism of monetary policy embedded in this type of models, other types of shocks are still needed to fit the data. For instance, Iacoviello and Neri (2008) estimate a DSGE model for the United States using Bayesian methods, and they find that preference (demand) and technology (supply) factors explain half of the variation in the housing sector, while monetary factors explain 20 percent. A similar result is obtained in Darracq-Parries and Notarpietro (2008) estimating a two-country model for the United States and the European Monetary Union (EMU).
The present paper strongly borrows from these last two references, and estimates a DSGE model with Bayesian methods using Spanish and EMU data, to shed light on the causes of the recent behavior of housing prices during the EMU period. As shown in Figures 1 and  2, housing prices soared in both economies during more than a decade, with double-digit increases (at an annualized rate) for the Spanish economy during most of the 2000s. The housing boom is also obvious from the real residential investment numbers, with again several periods of double-digit growth rates. A potentially important channel that is related to the effects of monetary policy is the reduction of interest rate spreads between Spain and its EMU partners during the mid 1990s. As agents assigned a large probability to the euro being created in 1999, and Spain belonging to the monetary union from the very beginning, interest rates rapidly converged to the european average ( Figure 3) as the currency risk premium disappeared. The spread in the 3-month T-bill rates narrowed from more than 300 basis points in early 1996 to basically zero at the end of 1998. Since then, the spread has remained at insignificant levels. 3 Finally, demographic pressures have been very important in Spain (Figure 4). Population growth has been much higher than the rest of countries of the EMU mostly due to immigration. In a addition, the baby boom generation, which is younger in Spain, reached the age of thirty during this period. Other demographic factors (increased divorce rates and single-parent families) have increased the number of households even more than the population growth rates, adding additional pressure to housing demand. To capture this effect, in the model, increased demand pressures due to population growth are captured with a housing demand shock.
To understand the role of declining interest rates, demographic pressures, as well as other factors in explaning the evidence we have just discussed, in this paper we build and estimate a two-country, two-sector model of a currency union, with durable and nondurable goods. Our model can be seen as a two-country extension of Monacelli (2008), from which we borrow the key ingredients. 4 The use of a two country setup allows us to provide a more realistic framework to study monetary policy in Spain since the launch of the euro. Our baseline specification does not include borrowing constraints, since we found this version of the model to fit the data better, unlike Iacoviello and Neri (2008) for the case of the United States. The model is estimated using standard Bayesian    1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 Household units Population methods, following the approach used by Smets and Wouters (2003) and Rabanal and Rubio-Ramírez (2008) in models of the euro area, and by Rabanal (2009) in a two-country model of Spain inside the euro area. Other DSGE models of the Spanish economy estimated with Bayesian methods include Burriel et al. (2008), and Andrés et al. (2008).
Turning to a preview of the results, we find that the prices of durable goods are more flexible than the prices of non-durable goods. This fact was first pointed out by Bils and Klenow (2004) and posed a challenge to the capability of the New Keynesian model to replicate the comovement between durables and nondurables consumption after a monetary policy shock. The posterior estimates also reveal that costly labor reallocation plays an important role in explaining the transmission of shocks in the Spanish economy: the higher posterior estimate suggests that labor market reallocation is more costly in Europe than in the US. Finally, we observe that the relative magnitude of the standard deviation of the shocks is similar across sectors within a country. However, all standard deviations of the shocks are higher for Spain. This suggests that the sources of variation of the housing sector are similar between the two economies, but the larger size of the shocks in Spain lead to a higher housing boom.
The model provides a good fit to most second moments of interest in the data, and hence allows us to decompose the sources of variation of the observable variables through the lens of the model. Overall, domestic technology shocks are the main source of variation of real residential investment and real consumption of non-durable goods, both in Spain and the EMU. For housing prices and the HICP, domestic preference shocks generate the bulk of the variation. Quite surprisingly, monetary shocks (both in the aggregate of the EMU as well as the declining risk premia in Spain) play a minor role explaining the housing price boom, against the view that the sustained low levels of real interest rates was behind it. On the other hand, monetary shocks explain an important fraction (about 20 percent) of the volatility of nondurable consumption both in Spain and in the rest of the EMU. We also find that both the durable sector technology shock and the housing preference shock have a positive and persistent impact on residential investment, but have negligible spillover effects to the rest of the economy.
Finally, to test for the importance that financial imperfections might play in amplifying housing sector cycles we extend the model to allow for a fraction of individuals that face borrowing constraints as in Iacoviello and Neri (2008) and Monacelli (2008). Using standard tools in the Bayesian model comparison literature (see Fernández-Villaverde and Rubio-Ramírez, 2004), we conclude that the introduction of borrowing constraints does not lead to an improvement of model fit to the data. On the other hand, we confirm the calibration results found in Aspachs-Bracons and , who show that the introduction of costly labor reallocation across sectors induces a positive comovement of private consumption and residential investment even when differences in the degree of nominal rigidities across sectors induce large relative price shifts.
The rest of the paper is organized as follows. In section 2, we present the model. In section 3, we discuss the Bayesian estimation and its implications. In section 4, we present some robustness checks. We leave section 5 for concluding remarks.

II. The Model
The theoretical framework consists of a general equilibrium two-country, two-sector model in a single currency area. The countries are of size n and 1 n, and each of them produces two types of goods, durables and non-durables, under monopolistic competition and nominal rigidities. Only the non-durable goods are tradable. Producers of the final durable good sell its product to domestic households only in each country, which allows them to increase their housing stock. For this reason, we use the terms "durable good production" and "residential investment" interchangeably throughout the paper.
In order to be able to estimate the model and avoid singularity problems in the likelihood function, the model contains eleven shocks. These shocks can be divided into demand (preference), supply (technology) shocks, and monetary shocks. For each sector, a demand shock leads output and prices to move in the same direction, while a supply shock will lead output and prices to move in opposite directions. Hence, we richly specify the shock structure to allow the model to be able to explain all possible patterns in the data, at the aggregate, sector-specific, and country-specific levels.

A. Households
Each household j in the home country maximizes the following utility function: where C j t denotes consumption of non-durable goods, D j t denotes consumption of durable goods and L i t is the labor disutility index. The utility function denotes external habit formation, as in Smets and Wouters (2003) and Iacoviello and Neri (2008). is the discount factor and is the inverse elasticity of labor supply. The parameter " denotes the importance of the habit stock, which is last period's aggregate consumption (C t 1 ). In addition, consumption of non-durables is an index composed of home and foreign consumption goods: where C j H;t and C j F;t are, respectively, consumption of the home non-durable goods and consumption of foreign non-durable goods by the home agent, and is the fraction of domestically produced non-durables at home. D t is a housing preference shock, that tries to capture exogenous changes in the demand for housing, as the demographic changes that we presented in Figure 4. H t is a home-consumption preference shock. Both preference shocks follow AR(1) processes in logs. Finally, following Iacoviello and Neri (2008), we assume that there is imperfect substitutability of labor supply across sectors, such that the labor disutility index can be written as: where L i;j t denotes hours worked by household j in each sector i = C; D, and is the economic size of each sector. This imperfect substitutability implies that there is a costly labor reallocation across sectors following a shock. Note that when L = 0 the aggregator is linear in hours worked in each sector, so there are no costs of switching from working in one sector to the other.
The budget constraint of the home agent, in nominal terms, is given by: where P C t and P D t are the price indices of durable and non-durable goods, to be defined below, W i t is the nominal wage in each sector i = C; D, and B j t denotes uncontingent nominal assets that are traded among households across the monetary union, and that pays (or costs) a gross nominal interest rateR t > 1: j t denotes nominal profits, because firms are ultimately owned by households. I D;j t denotes residential investment to increase the housing stock. We assume that the law of motion of the housing stock evolves as follows: where denotes the rate of depreciation of the housing stock and, following Christiano, Eichenbaum, and Evans (2005), we introduce an adjustment cost function, S (:), that is a convex function (i.e. S 00 () > 0). Furthermore, in the steady state S = S = 0 and S 00 > 0: The aim of introducing this cost is to allow for the possibility that the model can generate hump-shaped responses of residential investment to several shocks.
We assume that households in the home country have to pay a premium above the union-wide riskless nominal interest rate if the country's debt level as percent of GDP increases. This assumption is needed to obtain a well-defined steady state for the aggregate level of debt as percent of nominal GDP. 5 The relevant interest rate for the home households and the union-wide interest are related as follows: where P t is the aggregate price level, to be defined below, and Y t is real GDP, also to be defined below. R t is the riskless interest rate and is the risk premium elasticity. This risk premium depends on aggregate variables, such that each household takes this effect as given when choosing between consuming durables, non-durables, and saving. # t is a risk premium shock that affects the domestic interest rate but not the union-wide nominal interest rate. Note that the risk premium is declining in the net foreign asset position of the country as percent of GDP, Bt PtYt .
We can separate the household's decision as a two stage process. First, households choose the amount of labor to supply to each sector, and the consumption of durables and non-durables. Second, they allocate how much to spend in home and foreign produced goods, taking into account that, where P H;t denotes the price of home non-durable consumption goods and P F;t the price of foreign non-durable consumption goods. The variables corresponding to the foreign country will be denoted with an asterisk but the prices of foreign non-durable consumption goods do not carry it because they are also set in euros, and there is no price discrimination across countries.
The first order conditions to the household problem are given by: 6 Absent adjustment costs to residential investment, these three equations can be reduced to the following condition: 6 Since all households behave the same way, we drop the j subscripts in what follows.
Note that if the durable good was in fact non-durable (i.e. = 1), this condition simply states that the marginal utilities of consumption should equal relative prices. Since the durable good has a residual value the following period, this induces the extra-term of holding an additional unit of the durable good.
A standard Euler equation for the consumption of non-durable goods is: The labor supply conditions to both sectors are given by: The allocation of nondurable consumption expenditures between home and foreign-produced goods is: The price index for non-durables is (the CPI): The utility maximization problem of foreign country households is quite similar. We assume that the functional forms for preferences are the same across countries, but allow for different parameter values. That is, is the weight of non-durables in the utility function, and the fraction of domestically produced non-durables.

B. Producers
There is a continuum of intermediate goods producers, indexed by h 2 [0; n] in the home country, and by f 2 [n; 1] in the foreign country, that are imperfect substitutes of each other, and that supply final goods producers in each sector. There is a continuum of final goods producers in the two sectors that operate under perfect competition and flexible prices. Producers of the final durable good sell its product to domestic households only in each country. Producers of the final non-durable good sell their product to domestic and foreign households. Hence, it is important to distinguish the price level of domestic non-durable consumption goods, P H;t , which does not coincide with the price level of non-durables (P C t ) because of the presence of imported non-durable goods, whose price is P F;t .

B.1 Final Goods Producers
In the durable sector, final goods producers purchase intermediate goods and aggregate them according to the following production function: Profit maximization delivers the following demand for individual intermediate non-durable goods: where the price level is given by imposing the zero-profit condition.
In the non-durable goods sector, expressions are similar but with an appropiate change of notation since the price level of domestic non-durables and of a basket of durables is not the same. The aggregate production function is: individual intermediate non-durable goods demand is: where the price level is:

B.2 Intermediate Goods Producers
There is a continuum of intermediate goods producers, indexed by h 2 [0; n] in the home country, and by f 2 [n; 1] in the foreign country, that are imperfect substitutes of each other, and that supply final goods producers in each sector. Intermediate goods producers face a Calvo-type restriction when setting their price. In each period, a fraction 1 i in each sector (i = C; D) receive a signal to reset their price optimally. In addition, a fraction i index their price to last period's sectorial inflation rate whenever they are not allowed to reset their price.
Intermediate goods in both countries are produced with labor: ; for all f 2 [n; 1], and i = C; D: Note that in each country and sector, the production function is hit by country and sector specific technology shocks, each of which follows an AR(1) in logs. In addition, there is a non-stationary EMU wide technology shock with the following process: This shock gives growth to the model and delivers a model-consistent way of detrending the data (by taking first differences). Also, as long as the standard deviation of " a t is positive, there will be some correlation of technology shocks across countries and sectors, as in most of the International Real Business Cycle literature (see, for instance, Backus, Kehoe and Kydland, 1992).
In the remaining part of this subsection, we work out the conditions for the home country firms pricing decisions. In each sector, cost minimization implies that the real marginal cost of production is: Note that even though labor is the only production input, labor costs may differ across sectors because of imperfect labor substitutability, which can lead to different real wages. Also, real unit labor costs can differ because of the sector-specific technology shocks. This effect induces an additional channel of heterogeneous inflation responses across sectors, even when the parameters governing nominal rigidities are similar across sectors.
Firms in the durable sector face the following maximization problem: is the stochastic discount factor, and t is the marginal utility of non-durable consumption.
The optimal choice is given by: Given the assumptions about Calvo pricing, the evolution of the price level is: Firms in the non-durable sector face a similar maximization problem, and hence the optimal price and the evolution of the price level have similar expressions, with the appropiate change of notation.

C.1 Market Clearing Conditions
In each intermediate good, supply equals demand. We write the market clearing conditions in terms of aggregate quantities. Hence, we multiply per-capita quantities by population size of each country. Total production in the non-durable sector is equal to total domestic consumption and exports: while residential investment is used to increase the domestic housing stock: Hence, total output is, For the foreign country, the analogous conditions are: Total hours worked equals labor supply in each sector: Market clearing in the international bonds market is: Finally, the evolution of aggregate net foreign assets is:

C.2 Monetary Policy Rule
In order to close the model, we need to specify a rule for monetary policy, which is conducted by the European Central Bank with an interest rate rule that targets CPI inflation and also exhibits interest rate inertia: " m t is the monetary policy shock and the euro area CPI is given by a geometric average of the home and foreign country CPIs, using the country size as a weight:

III. Bayesian Estimation
We estimate the model of the previous section using standard Bayesian methods, following the approach used by Smets and Wouters (2003) and Rabanal and Rubio-Ramírez (2008) in models of the euro area, and by Rabanal (2009) in a two-country model of Spain inside the euro area. The Bayesian estimation approach has been presented in detail in these and other papers (see, for instance, An and Schorfheide, 2007) so we do not discuss it here. 7 Hence, in this section we describe the dataset that we use, the prior and posterior distributions of the models parameters, as well as posterior second moments and impulse responses from the estimated model.

A. Data
We use ten macroeconomic series to estimate the model: real private household consumption, real residential investment, the Harmonized Index of Consumer Prices (HICP), housing prices, and the 3-month T-bill rate for both Spain and the rest of the EMU. We obtain the first three series for each country from Eurostat. For housing prices in Spain, we use the free market housing price index published by the Spanish Ministry of Housing (Ministerio de Vivienda). For the euro area as a whole, we use the residential property price index published by the European Central Bank. For these four series, we obtain "rest of the euro area" aggregates by substracting from the euro area aggregate its Spanish counterpart series using Spain's weight in the EMU HICP. Also, since the series of housing prices of the euro area is half-yearly, we convert it to quarterly frequency by using linear interpolation. We seasonally adjust the data when it has not been done so by the original source. Finally, we use the three month T-bill rate for Spain and an aggregate of the euro area including the largest economies. We have discussed the behavior of these series in the introduction.
Our sample period goes from 1995:4 to 2008:2. There are several reasons that lead us to this choice. The first one is data availability: Eurostat provides harmonized national accounts and consumer price indices for all the member countries of the EMU only since 1995. The ECB index of housing prices starts in the second half of 1995. Second, we are using a model of a currency union and hence we should be including only data from 1999 onwards. Since this is a short sample period, we decided to include the 1995-1998 period too, making the assumption that agents anticipated that the EMU would be formed in 1999, and that Spain would be a part of it. A similar approach is conducted by Rabanal (2009). When estimating the model, we use quarterly growth rates of all price and quantity variables, and we divide the interest rates by 4 to obtain a quarterly equivalent. We demean all data. 8

B. Priors and Posteriors
In Table 1 we present the parameters that are calibrated before estimating the model. In the steady state, we assume zero inflation, that the trade balance is zero, and that the net international position of both economies is zero. Therefore, we only need to solve for the per-capita values of the home country, which are the same as those in the foreign country. We assume that the degree of monopolistic competition in both types of goods is the same ( C = D = ), and hence the ratio of all prices is one in the steady state. Note that the economic size of the nondurable sector ( ) and the weight of the nondurable consumption in the utility function ( ) cannot be solved separately. The optimal steady-state ratio of durable to non-durable consumption is: In a standard model with two non-durable goods ( ! 1) and no habit formation in nondurable consumption (" = 0), the optimal steady state ratio of the two types of goods would be equal to the ratio of relative weights in the utility function. The fraction of spending allocated to non-durable consumption over total spending ( ) is equal to: Given values for , , , and "; we can solve for the value of by putting together the previous ingredients, which leads to the following expression for : We set the size of the home economy to n = 0:1 and the size of the construction sector at 1 = 0:1, both in Spain and in the EMU, which is roughly the average size for the value added of the construction sector in the last decade. We calibrate the bilateral trade parameter ( ) based on total imports from the EMU to Spain over total spending, and calibrate its analogous parameter in the EMU ( ) in a similar way. In Table 2a we present priors and posteriors of the parameters of the model. First of all, we would like to remark that we use the same values of the parameters for both countries, including the AR(1) coefficients of the shocks. We proceed this way because we do not have a long time series (just 50 observations), and hence it is useful to restrict the number of parameters to estimate. Second, and most importantly, we have estimated versions of the model where the coefficients of the Phillips Curves (the Calvo lottery and the backward looking indexation parameter) and/or the AR(1) coefficients of the shock were different across countries. In all cases, we found that the numerical differences of parameter estimates across countries were small. We chose the specification that we present in Table 2a because the marginal likelihood of the models with different parameters across countries decreased. 9 The only parameters that are allowed to be different across countries are the standard deviations of the shocks. We now comment on the most important prior and posterior distributions of the parameters. The probabilities of the Calvo lotteries are Beta distributions, in order to keep them bounded between zero and one. The priors imply an average duration of optimal price changes of 3 quarters, as is standard in the literature for aggregate prices. Also, we do not force prices in the durable sector to be more flexible than those in the nodurable sector, so we set the same prior means for the Calvo lotteries of both types of goods. However, the posterior estimates indicate that the prices of durable goods are more flexible, a result that was first pointed out by Bils and Klenow (2004). The proportion of firms in the non-durable sector that cannot reoptimize prices in a given period is estimated at 0:87, which delivers a mean posterior average duration between optimal price changes of about 6 quarters. The proportion of firms in the durable sector that cannot reoptimize is much lower, 0:34, which would imply an average duration of about 1:5 quarters between optimal price changes. The prior mean for the parameters capturing the indexation to last period's inflation rate is also set symmetrically for both types of goods. The posterior estimates confirm that the proportion of firms that index their price to last period's inflation rate when they are not allowed to reoptimize is similar across sectors: 0:52 for the non-durable sector and 0:71 for the durable sector. Regarding the parameter that captures the habit formation, we set a prior mean similar to standard parameter estimates in the literature (see Smets and Wouters, 2003). The posterior mean confirm that the habits in non-durable consumption are an important element to capture the persistence of this variable.
The prior mean for the elasticity of substitution between home and foreign goods is set at 1 with a large standard deviation to account for uncertainty about its true value. The posterior estimate turns out to be much larger than the estimates usually obtained using DSGE models, which are typically well below 1 (see, for instance Lubik and Shorfheide (2005) and Rabanal and Tuesta (2006)). In this case, we obtain a posterior mean of 4:37 and the 95 percent posterior confidence interval rules out a value of 1. This suggests that home and foreign output are quite responsive to movements in the terms of trade. These results would be more similar to what is obtained in the trade literature using product or firm level data, as found for instance in Imbs and Mejean (2008). Costly labor reallocation also seems to play an important role. The prior mean is also set to 1, which is the value estimated for the US in Iacoviello and Neri (2008). The higher posterior estimate suggests that labor market reallocation is even more costly in Europe than in the US. Finally, the posterior mean for the parameter capturing investment adjustment costs is much lower than the prior. We selected a prior mean of 2 because in calibrated exercises this value allows to obtain a persistent response of residential investment to monetary policy shocks. However, the lower estimated value of 0:31 would suggest that such strong propagation mechanism is not needed when other shocks are allowed to explain residential investment. Finally, we obtain a risk-premium elasticity to the level of net foreign assets of 0:02, which is higher than the prior mean but in line with the evidence reported in Lane and Milesi-Ferretti (2001) for a group of OECD countries. The coefficients of the Taylor rule are quite similar to the priors and to what has been obtained in previous studies of the euro area.
In Figures 5 and 6, we plot the priors and posteriors of the parameters we have just  In Table 2b we present the prior and posterior estimates of the AR(1) coefficients and the standard deviations of the shocks. We set the prior means of the AR(1) coefficients to 0:7 for all shocks and we assume a Beta distribution to keep them bounded between zero and one. The posterior estimates show that the persistence of technology shocks in the durable sector is 0:94, while the estimated posterior mean of technology shocks in the non-durable sector is 0:83. The persistence of the preference shocks in the durable sector is the highest, 0:97, while that of home-produced tradable goods is 0:90. Finally, the persistence of the premium shock falls in between, with a posterior mean of 0:85. Figure 6 also plots the prior and posterior distributions, which in all cases are quite different, suggesting that the parameters are well identified. Following the results obtained in the literature, we set the prior mean of the standard deviation of monetary and risk premium shocks to be lower than for technology shocks. We do the opposite for preference shocks, but we set the standard deviation high enough so as to accommodate a wide range of parameter values. The posterior estimates confirm the low standard deviation of monetary and risk premium shocks, and among these two, the risk premium shocks are smaller than the monetary policy shocks. The standard deviation of the preference and technology shocks in the durable sector are higher than those in the nondurable sector.

C.1 Second Moments
Since it is difficult to draw conclusions by looking at the estimated processes for the shocks, in Tables 3a and 3b we present the posterior mean of selected second moments, as well as a 95 percent posterior confidence band, for the ten observable variables. To have an assessment of the fit of the model, we compare them with the actual second moments in the data. With regards to Spain, the model generates a standard deviation of residential investment which is higher than the standard deviation of non-durable consumption, as we observe in the data. The model also captures the higher volatility of housing prices with respect to the prices of non-durable goods, proxied by HICP inflation. The higher volatility of housing prices and quantities with respect to nondurable consumption is explained by higher volatility of the shocks in the durable sector, as well as a lower degree of nominal rigidity in that sector. The standard deviation of non-durables consumption implied by the model is higher than the one we observe in the data, but for the rest of the variables the fit is quite good: the actual standard deviation of each series is included in the 95 percent posterior confidence interval implied by the model. The autocorrelations generated by the model are also quite similar to the ones we observe in the data, specially for the first lags.  A similar conclusion is reached for the second moments generated for the variables of the EMU. As was the case with the Spanish data, the model is able to explain the high volatility of residential investment and housing prices, but it overstates the volatility of consumption growth of non-durable goods. At the same time, the model does a good job in explaining the autocorrelation of housing prices and the 3 month T-bill rate, but it does a worse job in getting the autocorrelations of CPI inflation, and of consumption and residential investment right. Given that the model is able to replicate the second moments of the data fairly well, we now turn to decompose the sources of variation of the observable variables. The results are presented in Table 4. Overall, domestic technology shocks are the main source of variation of real residential investment and real consumption of non-durable goods, both in Spain and the EMU. The opposite picture emerges for housing prices and the HICP. For those variables domestic preference shocks generate the bulk of the variation, while domestic technology shocks play a secondary role. These results are very similar to what Iacoviello and Neri (2008) find for the US, and Darracq-Parries and Notarpietro (2008) for the EMU. Regarding monetary shocks and risk premium shocks, together they account for almost one fourth of the variability of real consumption in Spain, but have a negligible effect in explaining the volatility of residential investment. Quite surprisingly, monetary shocks play a minor role explaining the housing price boom, against the widespread view that the sustained low levels of real interest rates was behind it (Brunnenmeier and Julliard, 2009). Finally, only 20 percent of the variation of the 3-month T-bill rate in Spain is explained by the risk premium shock, while 70 percent is explained by factors coming from the rest of the EMU. This result is somewhat expected given that since 1999 the risk premia have been negligible, and hence the 3-month T-bill rate in Spain moves closely with its EMU counterpart.  The qualitative results for the EMU are quite similar, but there are some quantitative differences. In the rest of the EMU, the innovation to the common technology shock explains more than 40 percent of the volatility of consumption growth and 20 of the volatility of residential investment growth. Similar to the Spanish case, however, technology shocks in each sector explain a large fraction of the volatility of real quantities, while preference shocks explain an important part of price inflation in each sector. Finally, monetary policy shocks also affect the behavior of consumption, explaining more than 20 percent of its volatility, but have a very small influence in the volatility of residential investment. To conclude this subsection, it is important to remark that there are not many spillovers of shocks across countries. In particular, the effects of Spanish shocks on the rest of EMU variables are basically zero in most cases. From the EMU side, the only shock that affects Spanish variables is the technology shock in the foreign nondurable sector, which explains about 20 percent of the volatility of inflation in Spain.

C.2 Model Simulation
A different way of looking at what shocks are behind the fluctuations in the data is to simulate the model with the shocks obtained using the Kalman smoother (Hamilton, 1994). The procedure works as follows: given a set of parameter estimates and the law of motion of the model, we use the observed data to obtain a series of shocks that, given the model, explain the data. In Figure 7 we present the decomposition of residential investment in Spain and housing prices in Spain. 10 Since the model has 11 shocks, in order to make the figure readable we present the percent contribution of each domestic shock (preference and technology, durable and nondurable), the aggregate technology shock, the -20% 0% 20% 40% 60% 80% 100% 1 9 9 6 Q 1 1 9 9 8 Q 1 2 0 0 0 Q 1 2 0 0 2 Q 1 2 0 0 4 Q 1 2 0 0 6 Q 1 2 0 0 8 Q 1

Housing Prices Spain
0% 20% 40% 60% 80% 100% 1 9 9 6 Q 1 1 9 9 8 Q 1 2 0 0 0 Q 1 2 0 0 2 Q 1 2 0 0 4 Q 1 2 0 0 6 Q 1 2 0 0 8 Q 1 Prefh Prefd Tech Techc Techd Mon/Pre Rest monetary and risk premium shock, and the rest of the shocks in the model, to overall fluctuations. As we can see in both panels, the red color and the yellow color dominate: these are the preference and the technology shock in the housing (durable) sector. On the other hand the importance of monetary factors is in general not important. In the period of longest expansion of the housing price boom (2002)(2003)(2004)(2005)(2006), the preference shock explains a very important fraction of the fluctuation, as well as in the subsequent deceleration. Also, monetary factors have had some contribution in the volatility of housing prices between 2004 and 2006, when the European Central Bank ended the sustained period of low interest rates at 2 percent. Quite surprisingly, the decline of the risk premia in the begining of our sample period does not appear to have contributed significantly to the housing price fluctuation in that period.

C.3 Impulse Responses
In order to better understand the propagation mechanisms implied by the model, in this subsection we comment on the effects of technology and preference shocks in the housing sector in Spain, and to monetary shocks. In order to focus the discussion on the housing sector in Spain, we do not present the responses to nondurable sector shocks and the response of EMU variables, which are available upon request. As we have just discussed in the previous subsection, the spillover effects across countries are quite small, and the qualitative effects of the EMU shocks on EMU variables are very similar.
In Figure 8 we present the response to a housing sector technology shock. As expected, this shock increases residential investment but decreases housing prices, by reducing the relevant real marginal cost in the durable sector. The response of residential investment displays a hump-shaped response, while the response of housing prices is more short-lived, with the decline in durable inflation only lasting one period. The spillover effects to the nondurable sector are small and nonsignificant at the 95 percent posterior confidence level. Figure 9 presents the response to a preference shock in the housing sector. This shock leads to a positive comovement between housing prices and residential investment, which is short lived in terms of the reaction of durables price inflation. The spillover effects to the rest of the economy are small, and nonsignificant.  Figure 10 we present the effects of a decrease of interest rates caused by a monetary policy shock in the euro area. In this case, both residential investment and private consumption increase, and so do the respective inflation rates. The comovement in the response of the two real variables matches the IRF to a monetary policy shock in Spain that we found in a related study using a VAR model. 11 Note that the increase of housing prices is larger than that of consumer prices, which in principle could lead to a decline of residential invesment due to the strong behavior of relative prices. However, as argued by Aspachs-Bracons and Rabanal (2008), the introduction of costly labor reallocation induces a positive response of private consumption and residential investment even when there are relative price shifts. Another mechanism empashized by the literature is the presence of borrowing constraints. 12

IV. Robustness: The Role of Financial Frictions and Labor Market Rigidities
In the previous section, we have presented several statistics to understand where our model fits the data, and what are the transmission channels that lead to our results. In this section we investigate what other ingredients suggested in the literature affect our results.
In a highly influential paper, Iacoviello (2005) showed that, in the United States, the presence of borrowing constraints is very important to explain the transmission mechanism of monetary policy. Iacoviello and Neri (2008) and Monacelli (2008) have also stressed the role of this type of credit frictions to help explain several features of the data, most importantly the comovement between residential investment and private consumption to a monetary policy shock. In this subsection we sketch how to extend the model along these lines. 13 We extend the model that we presented in Section 2 to allow for the introduction of a fraction of individuals that face borrowing constraints. More specifically, we assume that a fraction of households behave like the ones we presented in Section 2.1. These households have access to bond markets in the euro area and are able to make intertemporal decisions in the standard way. We now label these agents as "savers", following the standard terminology in the literature. Then, we assume that a fraction 1 of agents face some type of borrowing constraint in the credit markets. We label these types of agents as "borrowers", following the standard terminology in the literature. We denote variables for borrowers with a superscript B. Hence, borrowers maximize the 11 See Aspachs-Bracons and . 12 In order to save space we omit the response of a risk premium shock in Spain because the results are the same than with a monetary policy shock. The main difference between the two shocks is the way that they affect the rest of the euro area, but they have a very similar effect on the spanish variables. That is, the risk premium shock does not affect the rest of the euro area variables, while the monetary policy shock does. 13 An Appendix available upon request details the full equilibrium conditions of the model. where all the indices of consumption and hours worked, and the law of motion of the housing stock are the same as for the case of savers. Note that borrowers are more impatient and discount the future at a lower rate: B < . Their budget constraint in nominal terms is given by: where S B;j t is the amount of credit that borrowers receive from savers in each country of the currency union. The only way borrowers can smooth consumption intertemporally is by obtaining credit from the savers of the country, at the country-specific interest rate (R t ). Since the real interest rate of the current union is given by the discount factor of the savers, the borrowers would want to borrow an infinite amount. Borrowers also face a collateral constraint which is tied to the current value of durable goods: One can interpret the fraction as a down-payment rate, or one minus the loan-to-value ratio. Note that the ability of borrowers to obtain more funds against the value of their durable goods is affected by the price of durables.
We have estimated the role of introducing credit frictions of this type using the same Bayesian methods that we applied in previous sections. The only new parameter to estimate is the fraction of borrowers ( ) and savers (1 ) in this economy. 14 In order to compare the two models, we make use of the Bayes factor, which tells the researcher how she would update her priors on which model is the true one after observing the data. 15 In Table 5 we present the results of such estimation. In the first column of Table 5 we present the marginal likelihood of the model with two types of agents when we use a uniform prior between 0 and 1 for the fraction of borrowers in this economy. We also present the posterior distribution for . The rest of estimated parameters of the model do not change with respect to the ones we presented in Tables 2a-2b, so to focus the discussion we do not present them here. When we use a uniform prior (Borrowing Constraints 1 model), we find that the estimated is 0:94: this means that the fraction of agents that face borrowing constraints as implied by the model is only 6 percent. The (log) marginal likelihood of this model with respect to the model wtihout borrowing constraints is 479:80 versus 482:50. According to the Bayesian model comparison language of Kass and Raftery (1995), this difference in the log-marginals "barely deserves a mention": the implications of the two models for explaining the data are basically the same. When we compute the second moments of Table 3, the variance decomposition exercise of Table 4, and plot the impulse responses, the numerical differences are very small.

515:41
One could argue, however, that we are using aggregate variables and that the information content of these is not enough in order to be able to explain the behavior of the two types of agents. Hence, we reestimate the model with a more informative prior on that assumes a prior beta disribution with mean 0:6 and standard deviation 0:1. This prior distribution therefore implies that the model includes 40 percent of agents that face borrowing constraints. As we show in Table 5 (Borrowing Constraints 2 model), the posterior mean for this parameter declines to 0:74. But the marginal likelihood of this model declines further to 485:41. Therefore, by imposing a prior that implies that the model includes a larger fraction of borrowers, the model fit to the data declines, but by a very small amount. Hence, we conclude that the introduction of borrowing constraints does not lead to an improvement of model fit to the data, and simply implies an overparameterization of the model.
However, it could well be that other features of the model are making the importance of borrowing constraints in the model less relevant. Hence, we reestimated the models by assuming that there are no labor market rigidities and that labor reallocation is costless across sectors. Hence, we set L = 0, and reestimate the models. Two results stand out: first and most importantly, the marginal likelihood declines important. For the baseline model, the (log) Bayes factor of the model with and without labor costly labor reallocation is about 28: In the Bayesian model comparison language, this implies "very decisive evidence" in favor of the model with costly labor reallocation. The second important result is that introducing borrowing constraints does not address the problem of leaving labor market frictions aside: including financial markets frictions still implies a lower marginal likelihood.

V. Conclusions
During the last decade, Spain and the rest of the Eurozone experienced a large housing boom which fuelled residential investment in particular, but also economic growth. In Spain, at the same time, real interest rates plunged more than 800 basis points and remained at historical low levels, and population growth scored double digit rates during many years. The strong synchronization between these shocks and the housing boom has led many economists to draw a causal relationship between them. However, a formal analysis identifying the main drivers of the housing cycle is yet to be done.
In this paper we try to take a step forward in this direction by developing a two-country, two-sector New Keynesian DSGE model of a small country in a currency area. The model contains a rich set of demand, supply and monetary shocks. We also introduce labor market frictions since it has been shown to be an important tool when working with two sector models (Aspachs-Bracons and  and Iacoviello and Neri (2008)).
The model is estimated using standard Bayesian methods as in Smets and Wouters (2003) and Rabanal and Rubio-Ramirez (2008). This allows us to obtain a measure of the relative importance of each shock and it provides us with an estimate of the structural parameters of the model for the Spanish economy. In this regard, some results stand out. Interestingly, labor market rigidities appear to be stronger than those estimated for the US in Iacoviello and Neri (2008), while investment adjustment costs do not seem to play a major role. The relative dynamics of the two sectors also depends on the estimates of price rigidities. Similar to studies for the US (Bils and Klenow (2004) or Iacoviello and Neri (2008)), the price of durable goods is more flexible than that of non-durable goods.
The contribution of each shock in explaining the housing boom is obtained from the variance decomposition of the model and by simulating it with the shocks obtained using the Kalman filter. Both methods deliver similar results. First, supply/technology shocks explain most of the variation of the quantities of the two goods, durable and non-durable, while the variation of prices is mainly explained by preference shocks. Second, none of the monetary shocks, neither the interest rate shock nor the risk premium shock, play a significant role in explaining the housing boom. Monetary policy action only affected housing prices in 2006 and 2007, when the ECB raised the reference rate from 2% to 4%. Finally, sector specific shocks do not have spill over effects to the other sector of the economy nor the foreign economy. Given that the shocks that explain the dynamics of the two economies are very similar, we conclude that the different magnitude of the housing cycle in each economy was only due to the different intensity of the shocks.
Finally, since financial frictions have proved to be helpful in explaining the performance of durable goods in other economies (Iacoviello and Neri (2008) and Monacelli (2007)), we follow standard practice in the literature and assume that a subset of agents is more impatient and only can use a fraction of their assets as collateral to finance their consumption. Quite surprisingly, this does not help the model explain the data better, even if labor market frictions are removed.
As with any other type of econometric work, our results are conditional on the dataset we use, the model and the econometric strategy. A limitation of our approach is that the evidence presented in Figures 1 to 3 shows that the reduction of nominal interest rates ocurred between 1996 and 1999, while house prices growth rates peaked in 2004. It is difficult for state-of-the-art DSGE models to incorporate such sluggish transmission mechanisms, when compared to statistical models such as VARs. The model contains a wide range of shocks and frictions, including those which have been found to be more relevant to explain the effects of housing shocks (Iacoviello and Neri (2008)). At the same time, the model shares with the current state-of-the-art DSGE models the limited capacity to fully capture the effects of financial frictions on business cycles fluctuations. Introducing a shock to the loan to value ratio or other type of financial frictions, like labor income constraints, are possible venues to overcome this problem that we leave for further research.