1 Introduction

The housing market has played a fundamental role in the Spanish economy in recent decades. In particular, housing prices at the national level have exhibited remarkable swings over time. For instance, Martín et al. (2021) show that the housing boom in Spain affected the rest of the economy by increasing the net worth of banks and expanding the credit supply. Yet, the evolving heterogeneity in housing prices at the city level is a key feature that has remained somewhat overlooked.

This issue is important from a policy perspective because strong housing price synchronization across cities in a country provides grounds for the possibility that local shocks to housing prices affect the entire domestic real estate market and, thus, the real economy of the country (He et al. 2018). This can in turn increase the risk of periods of low economic activity, especially if coupled with buoyant credit markets. For instance, the last US housing boom was generated by spatial spillovers of local shocks from one real estate market to another, i.e., the synchronization of local markets over the 1995–2006 period (DeFusco et al. 2018; Ferreira and Gyourko 2022). In this respect, macroprudential policies can be effective tools to manage real estate dynamics and associated risks to the real economy and financial stability.

In Fig. 1, we show the evolution of the dispersion of housing prices for 50 major cities in Spain. While the cross-sectional distribution of housing prices in levels seems to have widened with time, the distribution of growth rates appears to have shrunk slightly. Based on this evidence, it is not easy to assess whether the cycles exhibited in Spanish city-level housing prices have evolved in a converging or a diverging pattern over time.

Fig. 1
figure 1

Housing prices dispersion across Spanish cities. Note. The black line plots the median housing price dispersion (in level and annualized growth, respectively) across fifty major cities in Spain. The red area corresponds to the cross-sectional distribution over time, with probability mass between the 5th and 95th percentiles

This paper aims to fill this gap by measuring changes in the synchronization of housing price cycles across Spanish cities over time. Our analysis is based on the multivariate regime-switching framework proposed in Leiva-León (2017), which is employed to identify the housing price cycles of pairs of cities and simultaneously infer the evolving relation between those cycles. We then summarize these pairwise relationships in an aggregate index of housing cycle synchronization at the city level. Our results show that Spanish housing prices converged over time. The convergence reached a maximum in 2009 and slightly decreased afterward. In addition, we identify the cities that were the main drivers of the convergence process. To do this, we compute the steady-state, or “average,” probability of being in a given regime (e.g., low price-growth regime). We then use this metric to classify cities with similar housing cycle dynamics. This allows us to distinguish between cities that exhibit strong price synchronization and cities that show low price synchronization in the period considered. Accordingly, the latter cities are those that are most related to the convergence process.

In a final exercise, we explore which factors might explain the synchronization pattern of city-level housing prices in Spain. We rely on a gravity-model type of equation, as in Funke et al. (2019), and consider economic and structural factors that have been shown to affect housing prices as candidates for explaining the synchronization metric. Our results provide suggestive evidence in favor of the hypothesis that the distance between cities, as well as differences in terms of population growth and the sectoral composition of the local economy, are relevant factors to explain the evolution of housing price synchronization among Spanish cities. The major caveat of this exercise is that we measure the dependent variable at the city level while the regressors are observed at the provincial level, due to data limitations. Hence, the explanatory variables may not accurately represent the city they refer to if they include information related to suburbs or metropolitan areas around the city. This may distort our results. However, in a sensitivity analysis we show that our findings are robust to the exclusion of the largest cities in the country, Barcelona and Madrid (see column (2) of Table 1), thereby reassuring us that this issue is not problematic in our case.

The literature on the evolution of housing price heterogeneity is scarce. Some studies have investigated the development of housing price synchronization across countries (e.g., Hirata et al. 2013; Katagiri and Raddatz 2018; He et al. 2018) by means of factor models, but few papers have focused on heterogeneity in housing prices at the city level.Footnote 1 For instance, Miao et al. (2011) estimate a dynamic spatial equilibrium model and show that house price contagion in US cities can be explained by migration spillovers between cities. Schubert (2021) analyzes spatial dependencies in housing prices across a number of US cities and shows that volatility linkages are more intensive during a real estate boom. In the same line, Ferreira and Gyourko (2022) and DeFusco et al. (2018) study the last US housing boom, looking at the evolution of real estate prices at the neighborhood level, and show that the latter was generated by a series of local booms that propagated from one local market to another, resulting in the 2007 boom that affected the entire country. This paper contributes to this literature by providing evidence on the evolving heterogeneity of city-level housing prices in Spain and investigating price synchronization patterns across Spanish cities.

The bulk of the literature on Spanish housing prices focuses on the period leading up to Great Recession, and mostly on specific aspects related to the price bubble that characterized Spain until 2007. For instance, Gimeno and Martínez-Carrascal (2010) study the links between home loans and house prices in the Spanish economy and show that while these two dimensions are interdependent, there is evidence of causality from home loans to house prices. By modeling potential disequilibria in both markets at the same time, they show that disequilibria in house prices can result in a false sense of no over-indebtedness, and vice versa. In addition, Gonzalez and Ortega (2013) study the impact of immigration on house prices and construction activity in Spain over the 2000–2010 period. According to their analysis, immigration resulted in an important increase in the working-age population and was responsible for one quarter of the increase in prices and about half of construction activity over the decade. Moreover, Rodriguez and Bustillo (2010) study the determinants of foreign real estate investment in Spain. This has grown considerably since 2000, and the bulk of these flows involves the investment of foreign tourists in real properties. Finally, Arrazola et al. (2015) estimate housing supply and demand elasticities for the 1975–2009 period in Spain and find that demand is highly sensitive to the labor market situation, as opposed to prices. In contrast, supply shows great sensitivity to variation in prices and interest rates. The authors argue that this different behavior of supply and demand with respect to prices makes the Spanish real estate market particularly prone to property bubbles.

In contrast, the most recent literature on Spanish housing prices generally describes the evolution of housing prices since the recovery in 2014, both at the aggregate level and at the city level. Alves and Urtasun (2019) describe the recovery of the Spanish real estate sector since 2014 and argue that increasing trends in both quantity and price-based indicators reflect positive labor market developments and the low cost of borrowing. López-Rodríguez and de los Llanos Matea (2019) study the Spanish rental housing market, which has gained weight since 2014, and discuss the main factors that have contributed to the recent increase in demand for residential rentals in Spain, such as high unemployment, precarious new employment contracts, a reduction in the average loan-to-value ratios of new mortgages, and the concentration of economic activity in geographical areas with a rigid supply of residential housing (in particular, Madrid and Barcelona).

The contribution of this paper to this recent literature is twofold: (i) the construction of a metric to measure changes in the synchronization of housing price cycles across Spanish cities over time; (ii) an investigation of the convergence process of city-level housing prices by looking at which cities contributed the most to price convergence and which factors explain the evolution of Spanish city-level housing price synchronization.

The paper is structured as follows. Section 2.1 presents the methodology used to measure changes in housing cycle synchronization, while in Sect. 2.2 we discuss the results and describe the convergence process of city-level housing cycles. In Sect. 3, we study the factors that explain the evolution of city-level housing price synchronization in Spain. Finally, Sect. 4 offers some concluding remarks.

2 Changes in housing cycles synchronization

2.1 Methodology

This section describes the methodology used to measure changes in the degree of synchronization between city-level housing price cycles. We rely on the approach proposed in Leiva-León (2017), for two main reasons. First, rolling window procedures are not needed to obtain time-varying measures of synchronization. Second, this method takes into account the nonlinear nature of the dynamics of housing price cycles. In sum, the framework consists of a bivariate regime-switching model that provides inferences on the cycles associated with each of the two underlying series and simultaneously evaluates the evolving degree of interdependence between these cycles.

The model can be briefly described as follows. Let \(y_{i,t}\) and \(y_{j,t}\) be the growth rate of the housing price index associated with cities i and j, respectively, and assume that they are interrelated through the following model:

$$\begin{aligned} \left[ \begin{array}{c} y_{i,t}\\ y_{j,t} \end{array}\right] = \left[ \begin{array}{c} \mu _{i,0}+\mu _{i,1}s_{i,t}\\ \mu _{j,0}+\mu _{j,1}s_{j,t} \end{array}\right] +\left[ \begin{array}{c} \epsilon _{i,t}\\ \epsilon _{j,t} \end{array}\right] , \end{aligned}$$
(1)

where \(s_{i,t}\) denotes a latent variable that can take two values. If \(s_{i,t}=0\), this implies that the housing prices of city i are in a low-growth regime at time t, given by \(\mu _{i,0}\). In contrast, if \(s_{i,t}=1\) this indicates that housing prices in city i are experiencing a high-growth regime at time t, which takes the value of \(\mu _{i,0}+\mu _{i,1}\). The same definition applies to the latent variable \(s_{j,t}\). Each latent variable follows a first-order Markovian process with transition probabilities between the two states given by \(p_{00}\) and \(p_{11}\), respectively.Footnote 2 The vector of disturbances \(\epsilon _{t}=[\epsilon _{i,t},\epsilon _{j,t}]'\) is assumed to be normally distributed, \(\epsilon _{t}\sim N(0,\Omega )\).

To assess the time-varying relationship between the latent variables measuring the housing price cycles, \(s_{i,t}\) and \(s_{j,t}\), we define

$$\begin{aligned} P(s_{i,t}=s_{j,t})=P(v_{ij,t}=1)=\delta _{ij,t}, \end{aligned}$$
(2)

where \(v_{ij,t}\) denotes a latent variable that takes a value of one if \(s_{i,t}\) and \(s_{j,t}\) are totally dependent at time t, or a value of zero if they are independent. Therefore, the term \(\delta _{ij,t}\) provides information regarding the time-varying synchronization between the cycles \(s_{i,t}\) and \(s_{j,t}\). Accordingly, the latent variable \(v_{ij,t}\) is also assumed to follow a first-order Markovian process with transition probabilities \(p_{ij,v}\).

The model in equations (1)–(2) is estimated with Bayesian methods due to the nonlinear dynamics it entails. For more details about the model and the estimation procedure, see Leiva-León (2017). This methodology has been previously employed to study changes in business-cycle synchronization between US states (Leiva-León 2017; Camacho and Leiva-León 2019), European regions (Gadea-Rivas et al. 2019), and different countries (Ductor and Leiva-León 2016).

2.2 Data and empirical results

This section provides a comprehensive evaluation of the changes in the synchronization of housing cycles across Spanish cities. Our data come from ST Sociedad de Tasación, which is one of the largest independent real estate valuation firms in Spain. It collects real estate prices (Euros/square meter) at a biannual frequency from 1985S2 onwards for 358 Spanish cities, including all provincial capitals, municipalities with more than 50,000 inhabitants, and other smaller towns with relevant real estate activity. This dataset only includes prices of non-protected new houses (on sell, either still in construction or occupied for less than 5 years) that are considered representative.Footnote 3 Prices are negotiated offer prices obtained through fieldwork in which SdT agents visit or contact promotions pretending to be a buyer. All collected data is filtered for outliers and aggregated through stratification to avoid compositional effects. Our sample spans 1985:S2 to 2018:S2 and we restrict our sample to 50 Spanish provincial capitals (all provincial capitals except for Ceuta and Melilla), which are listed in Table 2 in Section A of the Appendix.Footnote 4 An alternative available source is the Ministry of Transportation, which provides housing price data at the city and quarterly level from 1995 onwards. Comparing the price series for a number of cities, we find that both sources provide very similar information (see Fig. 4 in Section A of the Appendix). For this reason, we opt for the source that provides us with the longest time span.

To illustrate how the empirical framework works in practice, we provide detailed results associated with two selected pairs of cities that exhibited different synchronization patterns. The first case focuses on measuring the synchronization of housing cycles between Santander and Badajoz. The left-hand panels of Fig. 6 in Section B of the Appendix show the output of the model that consists of (i) the probability that housing prices in Badajoz are in a low-growth regime, (ii) the probability that housing prices in Santander are in a low-growth regime, and (iii) the synchronization between the cycles of Badajoz and Santander. The estimates show that between the late 1980 s and early 1990 s, the housing markets of these two cities exhibited different cyclical positions. This is reflected in the low values of the estimated synchronization, \(\delta _{badajoz,santander}\). However, from the mid-1990 s both cycles engaged in a synchronized phase that has remained until the present, as shown by the increase in the synchronization measure. The second case focuses on the synchronization of the housing cycles associated with Barcelona and Madrid. Analogously to the first case, the right-hand panels of Fig. 6 show (i) the probability that housing prices in Barcelona are in a low-growth regime, (ii) the probability that housing prices in Madrid are in a low-growth regime, and (iii) the synchronization between the housing cycles of Barcelona and Madrid, \(\delta _{barcelona,madrid}\). Unlike the first case, the estimates suggest that housing prices in these two cities have remained highly synchronized throughout the entire sample period.

The bivariate model in equations (1)–(2) is estimated for all possible pairs of cities listed in Table 2, and the synchronization measures associated with each pair, \(\delta _{i,j}\) \(\forall \) \(i \ne j\), are retained. In Fig. 2a, we plot the evolution of the cross-sectional distribution associated with all estimated synchronization measures, along with its corresponding mean and median.Footnote 5 The figure shows a shrinking of the cross-sectional distribution over time. This points to a remarkable convergence pattern of city-level housing price cycles. More specifically, during the 1990 s and early 2000 s one group of cities underwent a convergence in housing price cycles toward another group of cities that has remained highly synchronized for the entire sample. Figure 2 plots the mean and median of the cross-sectional distribution. These statistics provide information about the changing degree of synchronization of the Spanish housing market, suggesting that it increased persistently until the housing bubble burst in 2008 and decreased afterward.

Fig. 2
figure 2

Aggregate synchronization of city-level housing price cycles. Note: a plots the evolution of the cross-sectional distribution of the estimated synchronization measure along with its mean (dotted blue line) and median (solid black line). b shows the mean (dotted blue line) and median (solid black line) of the cross-sectional distribution

The convergence of city-level housing cycles has been a gradual but persistent process that started several decades ago. This is illustrated in Fig. 3, which plots the kernel densities associated with the synchronization measures for three selected time periods: (i) the beginning of the sample in 1989, (ii) the housing bubble in 2007, and (iii) the end of the sample in 2018. Besides documenting this convergence pattern in regional housing cycles, it is also crucial to identify the cities that have contributed the most to this convergence.

Fig. 3
figure 3

Distributions of housing cycles synchronization for selected periods. Note: The graph shows kernel densities associated with pairwise synchronization measures for three selected time periods: (i) the beginning of the sample in 1989S1, (ii) the housing bubble in 2007S1, and (iii) the end of the sample in 2018S1

In order to identify the cities that have acted as the main drivers of the convergence process, we classify cities based on their cyclical commonalities. For each pair of cities, we compute the steady-state, or “average,” probability of being in a given regime.Footnote 6 Based on these steady-state probabilities, cities are classified into groups with similar housing cycle dynamics, which are shown in Fig. 5 of Section B in the Appendix. The cluster tree, or dendrogram, suggests the existence of three salient groups of cities. The height of each U-shaped line represents the cyclical dissimilarity between the two cities being connected. We observe a large group of cities that exhibit relatively low dissimilarity, or high synchronization (in blue). In addition, there is another large group of cities (in red) that shows a relatively higher degree of dissimilarity, or lower synchronization. Lastly, there is a small group composed of only three cities that also exhibits a low degree of synchronization (in green). Based on this classification, it can be inferred that since the groups in red and green exhibit a lower degree of synchronization, the cities in these groups could be those most strongly linked to the convergence process.

Since the convergence of city-level housing cycles has been a dynamic process, it is important to evaluate cities’ cyclical affiliations in a time-varying fashion, so as to provide an accurate assessment of the main contributors to this process. We thus rely on multidimensional scaling analysis to provide a mental map of the associations between cities over time, controlling for the importance of steady-state grouping patterns. Figure 7 of Section B in the Appendix plots the dynamic mapping of housing price synchronization for selected periods, including the beginning and end of the sample, and the middle of the housing bubble. Each point in the figures represents a city, and the proximity of two points in the plane refers to their degree of synchronicity, that is, the closer the points are, the greater their synchronization.Footnote 7 The figure shows that the synchronization between cities in the blue cluster has remained high and stable over time. Instead, cities in the red cluster have exhibited an increasing degree of synchronization over time, while the cities in the green cluster have remained mostly unsynchronized. This confirms that the cities in the red cluster have contributed the most to the housing cycle convergence process since they engaged in a synchronized phase with the cities in the blue cluster, yielding a decline in the cross-sectional heterogeneity of housing prices.

3 Relevant housing market characteristics

3.1 Model

This section proposes an empirical explanation for the documented synchronization patterns of Spanish city-level housing prices. We do this by estimating gravity models, which is standard procedure in the empirical international trade literature to explain trade patterns. In a nutshell, gravity models study the volume of spatial interactions between places (e.g., cities, regions, or countries), finding that places of similar economic size are attractive to one another in terms of trade, while a greater distance between places weakens their attractiveness. Researchers have borrowed this economic framework to explain other types of interactions, such as stock market correlations (Flavin et al. 2002) or housing price synchronization (Funke et al. 2019). We investigate the sources of housing price synchronization by adapting a typical gravity model from the trade literature to capture housing price co-movements between cities.Footnote 8 The variables that are allowed to influence housing price synchronization are the standard geographical distance between two cities (the closer the cities, the more synchronized the housing prices) and relevant demographic and economic determinants of real estate prices identified in past studies, which are described below.Footnote 9

First, migration patterns and population growth are expected to affect demand for housing and, hence, housing prices. The population that is most relevant for housing markets is individuals 25–35 years of age, given that this age group generally faces the choice between buying or renting a home. To account for this, we control for the growth rate of the population aged 25–35 years of age (POP).Footnote 10

Another relevant factor to explain housing price dynamics is disposable income. The wealthier the households, the higher the demand for housing and the greater the pressure on prices. We use the rate of employment growth (ER) at the provincial level as a proxy for the local economic situation.Footnote 11

In addition, we consider the economic structure at the provincial level. Intuitively, cities with a similar local economy sectoral composition are likely to be more synchronized. For instance, local economies that are mostly driven by the services sector are likely to face greater demand for housing and, hence, higher housing prices, as opposed to cities in which other sectors predominate. To account for this, we compute the weight of the main sectors in the local economy (e.g., agriculture, services, construction, and industry) and define the fraction of employees working in a given sector in each province as the city-level proxy for the weight of the sector in the local economy.Footnote 12

Overall, we expect the divergence in housing prices between two cities to be associated with greater geographical distance and differences in terms of the sectoral composition of the local economy, as well as population growth and local economic conditions.

We borrow the econometric framework of Funke et al. (2019), who carried out the same analysis for China. We consider 50 Spanish provincial capitals for the 1989S1–2018S1 period.Footnote 13 We estimate the following equation, where the unit of observation is a pair of cities \(\{i,j\}\):

$$\begin{aligned} (1-\delta _{ij, \tau })= & {} \alpha + \sum _n \beta _{n} \left| X_{n,i,\tau -1}-X_{n,j,\tau -1} \right| \nonumber \\{} & {} + f_{i} + f_{j} + f_{t} + \gamma log(distance_{ij}) + v_{ij, \tau ,} \end{aligned}$$
(3)

Sub-indexes i and j define the city pair, and sub-index n refers to the number of time-varying control variables included in the specification. \(\delta _{ij}\) is the city-pair-level price synchronization metric, such that the dependent variable represents the degree of divergence in price between two cities.Footnote 14 The right-hand side of the equation includes a constant, the log of the distance between two cities in a pair, and a set of time-varying explanatory variables (X).Footnote 15 The latter are defined at the city-pair level and are transformed as absolute differences between city i and city j. Time-varying regressors are observed every 6 months and lagged by one period to minimize endogeneity concerns.Footnote 16 In addition, the specification includes city-i and city-j fixed effects (\(f_{i}\) and \(f_{j}\)) to control for all constant city-specific characteristics affecting housing price synchronization patterns between cities, as well as year fixed effects (\(f_{t}\)) to control for common trends affecting the price cycles of all city pairs. This is in line with the estimation of gravity models in the empirical international trade literature (Baltagi et al. 2014; Feenstra 2015). The equation is estimated using the OLS method. Standard errors are two-way cluster-robust with clustering on city i and city j, which relaxes the i.i.d. assumption of independent errors, allowing for arbitrary correlation between errors within clusters of observations (see Cameron et al. 2011).

3.2 Results

Results are reported in Table 1. The following comments are worth noting.

First, the geographical distance between cities shows a positive and significant estimate: The closer the cities, the more synchronized the housing prices, since the demand for housing may overlap. This result is robust across specifications and confirms that distance matters for housing markets, in line with what has been found by the international trade literature regarding goods markets (e.g., Ortega and Peri 2014).

Second, and as expected, the coefficients associated with the growth rate of the population aged 25–35 years are statistically significant and show a positive sign across all models. This suggests that differences in population growth between two cities are associated with housing price divergence.Footnote 17

Table 1 Variables associated with housing prices divergence between Spanish cities

Third, differences in terms of the local employment rate also show a positive coefficient, although it is not statistically significant. This result provides only weak evidence in favor of the working hypothesis that housing prices in cities with similar economic conditions tend to move together, while the housing markets of cities with different employment prospects tend to be less synchronized.Footnote 18

Fourth, sectoral composition is associated with the housing price synchronization metric, with the expected (positive) sign, suggesting that cities with a similar economic structure show greater synchronization in housing prices. These results are quite robust across all specifications and refer mostly to the agricultural and services sector.Footnote 19

The other columns in the table report the results of a number of robustness exercises. The first relates to the fact that, in Spain, most of the economic activity and jobs revolves around two major cities, Madrid and Barcelona. These two cities are also very different with respect to all other cities in terms of dimensions. Hence, the housing price dynamics in Madrid and Barcelona may be peculiar and could distort the analysis. Therefore, we estimate the models excluding Madrid and Barcelona (see column (2) of Table 1). Finally, column (3) of Table 1 shows the results from estimating the models excluding the cities in the green cluster (Teruel, Avila, and Vitoria/Gasteiz), since the synchronization cycles of these cities follow independent patterns, as shown in Sect. 2.2. These additional exercises confirm our baseline results.

Finally, another factor that may help explain housing price co-movements between cities is tourism. To control for this, we add a dummy equal to one when city i lies on the coast and zero otherwise. Since the regressors in the gravity model are the differences across city pairs (in absolute value), the coast dummy becomes 1 if one city in a pair is on the coast and the other is not and zero if both or neither cities are on the coast. Unfortunately, the coefficient associated with this variable is very small and not significant (see Table 4 of Section C in the Appendix).Footnote 20

4 Conclusions

This paper provides a metric to measure the synchronization of housing price cycles across Spanish cities and studies changes in city-level price synchronization over time. We focus on the period from the first semester of 1989 to the first semester of 2018. To measure synchronization, we first use a regime-switching framework that identifies the housing price cycles of pairs of cities and simultaneously infers the evolving relation between those cycles. Then, we aggregate these bilateral relationships into an overall index of city-level housing cycle synchronization. The evolution of this aggregate index suggests that Spanish city-level housing prices converged in the period considered, with synchronization reaching a peak in 2009 and decreasing slightly afterward. In addition, we identify the cities that contributed the most to price convergence and explore whether economic and structural factors affecting housing prices contribute to explaining housing price synchronization dynamics. According to our results, the distance between cities, as well as differences in terms of population growth and the sectoral composition of the local economy, are relevant to explaining the evolution of housing price synchronization among Spanish cities.

Note that due to data limitations, our analysis is subject to a major caveat: the fact that we measure the dependent variable at the city level while the regressors are observed at the provincial level.Footnote 21 Hence, the explanatory variables may not accurately represent the city they refer to if they include information related to suburbs or metropolitan areas around the city. However, the fact that our results are robust to the exclusion of the largest cities in Spain reassures us that, in our setting, this issue is not problematic.