1 Introduction

In addition to its social importance in human life, housing is also one of the primary investment instruments for investors and households in Turkey. In countries with a high population growth rate and where capital markets are not deep enough, housing investments are widely preferred by individual investors. As a result of this, in these countries, housing demand and housing prices remain generally alive, and housing prices can increase more rapidly compared to developed countries. Undoubtedly, the development of house prices is directly or indirectly affected by many factors. While the main determinants of housing prices are construction costs, the quality of building elements, location, security, transportation facilities and social facilities, macroeconomic and microeconomic factors also have a significant impact on housing prices. These external factors can sometimes cause overvaluation and bubbles in housing prices.

The price bubble implies that the market price of an asset is significantly higher than its real value. The price bubble is a situation where the market price of an asset is not supported by the main price factors of that asset. In other words, an asset bubble occurs when there is a dramatic increase in the price of an asset that is not supported by its main price factors. In a market environment where prices are at their real value levels, the expectation among investors that prices will increase even more in real terms is the main factor that stimulates the price bubble formations. However, asset prices vary depending on the market conditions that are greatly exposed to global factors and as a result of this, “real value” and “price bubble” definitions may differ according to the current global conditions. In addition to this, housing prices are very sensitive to local factors, and the market dynamics vary considerably from country to country. So, the definitions of the housing price bubble may vary regionally, and it makes it difficult to develop a universal housing price bubble measurement method or a price bubble detector. Housing prices may follow different trends not only among different countries but also in different regions in the same country. For example, Wu and Lux (2018) show that residential property price growth has different short-run momentum at the regional versus the national level; in other words, in different regions housing prices are affected differently in the short term.

According to Stiglitz (1990), the price bubble emerges when the investors believe that current prices are at a satisfactorily high level, and the main factors that affect the price no longer support current prices. In other words, when the idea that the current prices will no longer allow profitable sales in the future among the housing investors is common, the housing bubble appears. While a housing price bubble is still in its formation phase, people may find the high housing prices acceptable with the expectation that the prices will keep rising. They act with the concern that if they do not buy the house at that moment, they will never be able to buy it later due to subsequent possible price increases (Case and Shiller 2003). However, it is not possible for prices to rise forever. When people feel that prices will no longer rise, demand will decrease and accordingly prices will begin to drop and the price bubble will begin to deflate (Case and Shiller 2003).

According to another definition by Lind that analyzes the concept from a different perspective and associates the price increases to the time period, sudden and sharp decreases in real asset prices following the dramatic rise over several months or years are called price bubble (Lind 2009). To make a comprehensive definition for the concept of the housing price bubble, Oust and Hrafnkelsson (2017) carried out an extensive study on the quarterly data of the 20 OECD countries for the period of 1975–2015 and on the annual data back to the 1800s of the six countries and two major cities. According to this new definition that developed Lind’s previous definition, a dramatic increase in real prices at least 50% during a 5-year period or 35% during a 3-year period, followed by an immediate dramatic fall in the prices of at least 35% is called large price bubble. Accordingly, a dramatic increase in real prices at least 35% during a 5-year period or 20% during a 3-year period, followed by an immediate dramatic fall in the prices of at least 20% is called small price bubble.

However, rapidly changing market dynamics today can override the old definitions of price movements and the prices described as “bubble” based on the previous definitions can continue their rising trend for many years. Instead of resulting in a price bubble followed by a sharp drop, it is also possible that prices will remain at high levels depending on the its own dynamics of the housing market. Indeed, since the mid-2010s, claims about the price bubble in Turkish housing market are being intensively discussed in academic literature and among the actors in the sector. However, up to now, there has not been a serious price decline in the housing market yet. It is observed that such discussions regarding the housing price bubble and risks of the housing sector have increased gradually in Turkey, especially with the economic slowdown since mid-2018.

Undoubtedly, the main factor that makes the housing bubble a concern for the world financial literature is the housing industry’s financialization level. The large volume of financial assets derived from mortgage loans and the high risks arising from this process have made global markets extremely sensitive to the house prices that these financial assets are based on. The size of financialization of housing market especially in developed countries and the 2008 global mortgage crisis that emerged as a result of this financialization process sharply increased the academic interest in the housing price bubbles and this issue gained a big importance. In this process, the housing sector and securities based on mortgage loans have become an important source of the financial crises and the fragility of the banking sector. So, housing bubbles have also become an important subject of the macroeconomic researches (Vogiazas and Alexiou 2017). Although the rising trend in housing prices contribute to the national income in the short term by increasing housing expenditures and housing production, the overvaluation of housing prices can disrupt the efficiency of capital allocation in the economy. Therefore, this process may adversely affect economic growth in the long run by causing investments to shift from more productive areas to the housing sector (Aizenman et al. 2019).

In this study, housing price bubbles are being searched in some selected districts of Istanbul. Contributions to the literature with the paper can be listed as follows:

  • We built our own dataset of \(N=7\) districts of Istanbul monthly and quarterly time series frequencies from 2007 June to 2019 December.

  • We proposed a LSTM autoencoders to detect housing bubble considering relationship between housing prices and some macro- and microeconomic variables.

The rest of this paper is organized as follows: Sect. 2 presents an overview on Turkish housing market. Section 3 gives relevant works on housing bubble in detailed. Section 4 describes the study area, data preparation process and our deep learning model, LSTM autoencoder. Section 5 deals with the realized experiments and gives a discussion. In the last section, we conclude the paper and propose some future research directions.

2 An overview on Turkish housing market

In Turkey, housing investments have always been an extremely popular investment choice, but, however, the housing finance has not reached the level in the developed countries yet and the financialization level in housing market is still relatively weak. It has been long speculated about a price bubble in the Turkish housing market; however, there has not been a sharp decline in the prices to confirm this claim yet. As stated above, housing investment is a widely preferred investment alternative for individual investors in Turkey. As this situation always keeps the potential demand strong, the housing market is relatively more resistant to the risk of price bubble. Moreover, it is not possible to describe every price increase movement in housing market as a price bubble. Factors such as income growth, population growth rate and immigration from other countries can raise the level of housing demand and prices permanently, without creating a price bubble. In addition to the high population growth rate in Turkey, millions of immigrants were added to the population in the last 8 years, and this situation also continues to feed the housing demand. Also, rapidly increasing land and construction costs are among the strong factors of the increasing trend in housing prices. As a result of all these factors, the rent multiplier ratio and the payback period of housing investments have increased rapidly for Istanbul during the 2000s, and these indicators still maintain high levels. Rather than defining it as a price bubble, Büyükduman relates this situation to the decline in inflation during these years and points out that the rent multiplier rates for Istanbul were lower during the high inflation period (Büyükduman 2014). In our opinion, it seems that the housing price bubble potential in Istanbul is currently available on a local scale rather than the entire market. For the near future, the continuation of the economic slowdown is the main threat that could cause a sudden drop in demand and remarkable price decreases in housing market especially for some districts.

The construction sector in Turkey has been operating with significantly high debt leverage, and foreign currency debts have an important share in its total liabilities. In this respect, if there is a sudden fall in housing demand, price decreases will directly affect the liquidity and payment ability of the building companies with high housing stock volume, and then, this will also negatively affect the asset quality of the banks. Considering the possible effects of this situation on other sectors in which the construction sector interacts closely, it is clear that a sudden drop in demand and price collapse in the housing market will have serious effects on the Turkish economy. As a matter of fact, along the economic slowdown experienced in recent years, the government’s move to reduce interest rates of housing loans through state banks is due to the importance of this risk.

Following the 2008 global financial crisis, interest rate cuts and monetary expansion (quantitative easing) process that started in the developed countries rapidly increased the global money supply and significantly reduced fund costs. Turkey has been one of the countries that benefit most from foreign capital inflows during this period. These low-cost loans and portfolio investments have constituted the basic dynamics of the rapid growth in Turkish economy during this period. The housing sector has made a dramatic development in these years. Factors such as population growth, the high proportion of aged and earthquake-proof houses in the existing housing stock, increasing demand for more qualified houses and government incentives for urban transformation projects have rapidly increased the housing supply in that period. High-demand and high-profitability opportunities increased the sector’s risk-taking tendency, and consequently, housing producers have operated with high financial leverage and foreign exchange risk. During these years, opportunities to access long-term and low-cost foreign funds have increased significantly for banks, and thus, rapidly increasing housing loan supply also fostered housing demand.

Following a long period of growth, the Turkish economy has entered a slowdown in the third quarter of 2018. Besides that, Turkey’s risk premium and international borrowing costs started to rise due to the quantitative tightening and interest rate hikes in the USA. In this period, mortgage loan volume and housing sales were on a downward trend compared to the same period of the previous year. Mortgage loans and housing sales started to rise again in August 2019 with the cuts in the housing loan interest rates (https://www.tbb.org.tr/en/banks-and-banking-sector-information/statistical-reports/20, http://www.turkstat.gov.tr/UstMenu.do?metod=temelist) led by the state-owned banks in line with government directions. When the data are analyzed, it is seen that the main source of this increase in housing sales is substantially low-interest mortgage loans. This is also remarkable in terms of the sensitivity of housing demand to the mortgage credit interest rates in Turkey.

The building construction sector was caught this economic slowdown in 2018 with a high debt ratio, a high exchange rate risk and a serious housing stock. Indeed, in its statement on September 17, 2019, Banking Regulation and Supervision Agency pointed out that the credits allocated to the construction and energy sectors took the biggest share in the nonperforming loans of Turkish banks (https://www.bddk.org.tr/Announcement/Press-Release/730). On the other hand, trying to solve the structural financial problems of the construction sector with temporary measures such as government-driven interest rate cut campaigns has the potential to cause the existing risks to grow even more. Also, carrying the bad debts of the building companies within a continuous debt restructuring program has the potential to deteriorate the asset quality of banks in the medium term. These government-directed low-interest-rate housing loans that allocated under “overly optimistic” expectations constitute another potential risk for the banking sector. If these optimistic expectations on the economy are not realized and therefore an extensive default occurs on mortgage loans, this could create a highly serious problem for both the housing market and the banking sector.

As of 2019, there was a serious unsold housing stock in the housing market in Turkey, which has made the sector extremely vulnerable to macroeconomic risks. As a result of this trend, new construction investments have slowed down considerably and the number of building licenses, which has been on the rise for many years, has decreased dramatically in 2018 and 2019 (http://www.turkstat.gov.tr/UstMenu.do?metod=temelist). Under these circumstances, speculations about housing price bubbles and the probable sharp price drops have become a disincentive factor that delaying and restricting the housing demand. In order to prevent a serious crisis risk, government provided low-interest-rate housing loans through state banks, and (undoubtedly, its target is not only limited to the housing market) implemented a low-interest policy through Central Bank starting from the second half of 2019. Although these policies reduced the risks of building companies, house prices continued to increase in this period due to the stimulated demand, and as a result, the price bubble risk was postponed and transferred to housing customers. Today, especially for some districts of Istanbul, the housing bubble speculation is going on and the issue still maintains its importance.

3 Literature review

Although the discussions and studies on asset price bubbles go back many years, it is seen that the housing price bubbles started to attract more attention in the finance literature since the 1990s and this interest increased rapidly after the 2008 mortgage crisis. For the determination and prediction of the housing price bubbles, analyses are carried out on a country or city basis, using various econometric methods over many macro- and microfactors affecting the housing prices. In these studies, housing prices are analyzed mostly through macroeconomic indicators, primarily national income. But since housing prices are heavily influenced by local factors, the results of these studies cannot be fully generalized. Çankaya (2013) reveals the relationship between housing prices and macrovariables such as employment, population and gross domestic product (GDP) using panel data analysis on 75 countries classified under five subgroups. He also points out that there are differences between country groups in the power and direction of macroeconomic variables to explain the changes in housing price indexes. There are also some other studies confirming this finding. Himmelberg et al. (2005) investigated the relationship between housing prices, regional house rents and income levels for a period of 25 years in 46 major cities in the USA. According to the results, there is not a remarkable price bubble in the housing market as of 2004. The researchers also concluded that the housing price dynamics have local characteristics, changes in housing price factors can affect cities in different ways and for this reason datasets at national level can conceal some important differences between the cities.

It is seen that GDP is the most widely used macroeconomic variable in housing price bubble analysis. In addition, interest rates, exchange rates, inflation rate and population variables are also associated with the housing price movements. Hui and Qi (2009) analyzed housing prices for the 2004–2008 period using the state-space model for Guangzhou city, and they also present a large literature on the positive relationship between housing prices and income levels. The results show that there was a serious price bubble in October 2007 at around 43%. In their study, the relationship between the house prices and household income was analyzed and it was concluded that there was a serious disparity between the income growth rate and the level of the house price in favor of the house prices. They suggest that this situation points to a price bubble. Shen et al. (2005) investigated whether there is a housing price bubble in Beijing and Shanghai as of 2003, using the Granger causality test and generalized impulse response analysis with the variables of housing price index, disposable income, regional income, stock market index and housing vacancy rate. According to the analysis results, they reached the 22% housing price bubble for the Shanghai city. In another study performed by Lu et al. (2015), housing price index, GDP, consumer prices index, base lending rate and housing supply variables were analyzed with the fully modified ordinary least squares regression method over the period of 2000–2012 for Penang city in Malaysia. According to the results, a price bubble formation was not seen in the housing market, and it was observed that inflation and the cost of borrowing factors can significantly explain the changes in housing prices.

In their study for the Chinese housing market, Dreger and Zhang (2013) reached serious price bubble evidences for some cities within 35 major cities using panel cointegration techniques on a dataset consisting of housing prices, interest rates, national income, population and inflation. In another study, Mahalik and Mallick (2011) used the cointegration test and vector error correction model (VECM) to investigate the relationship between housing prices and real income, short-term real interest rates, real stock exchange index, real effective exchange rate and real non-food bank loans. They concluded that there is a significant positive correlation between housing prices and real income in the long term, while non-food bank credit adversely influences the housing prices. Vogiazas and Alexiou (2017) analyzed the dynamics of housing prices with the Generalized Method of Moments (GMM) over real GDP, unemployment rate, real effective exchange rate, bank credit growth and long-term bond yields, over the period 2002-2015 using quarterly data. They found out that residential property prices and credit creation, long-term bond yields and real effective exchange rates are intertwined variables, and housing bubbles are largely synchronized with excessive credit creation, coinciding or even leading the business cycle.

Although the housing price bubble researches are largely based on macroeconomic indicators, microfactors such as housing construction costs, housing-based income and mortgage loan interest rates also have a serious impact on housing prices. As a matter of fact, the main factor of the rapid rising trend in housing prices during the early 2000s in Europe is the low interest rates on housing loans (Taipalus 2006). Gounopoulos et al. (2012) found a positive relationship between housing prices and construction costs, and a negative relationship between housing prices and long-term interest rates in their research covering the period of 1985–2010. In the study, it was also concluded that there is an inverse relationship and substitutability between the stock market and housing market investments. High volatility in the stock market causes households to turn toward housing investments, resulting increase in housing prices.

Asal (2019) examined the housing price bubble using the asset pricing approach. He calculated the long-term housing prices for the period of 1986–2016, based on the price-to-income ratio, price-to-rent ratio and user cost factors. By comparing these calculated values with market prices, he searched the price bubbles in the Swedish housing market. According to the findings, a price bubble has been found in the housing market since 2004, and housing prices have been above the long-term averages in these years. It was observed that these bubbles did not show continuity and returned to basic values at certain intervals, but these deviations were continuous. In another study examining the issue with the asset pricing approach, Bourassa et al. (2019) has investigated the most effective method for monitoring and detecting price bubbles using a wide range of methods for 6 metropolitan housing markets in 3 countries over 30 years of quarterly data. According to the analysis results, the price-to-rent ratio was found to be the most reliable method in detecting price bubbles. In another study, Mikhed and Zemčík (2009) tested the relationship between the housing prices and the house related earnings in the US metropolitan statistical areas by using panel data analysis. They set up a simple procedure for detecting price bubbles and compared the panel data tests with the price-to-rent ratios for every decade. They determined price bubbles in US housing market in the late 1980s and early 1990s and the period from the late 1990s to 2006. There is also another study in the literature suggesting that there is a price bubble in the US housing market in the 1990s. Berlemann et al. (2019) show that in the process leading to the 2008 global mortgage crisis, the first housing bubble appeared in 1996/1997 in the USA. It seems that a very similar result was achieved in another study. Freese (2015) tried to determine the probable starting points of housing price bubbles in different regions of America, using regional data from 1990 to 2010 and methods of statistical process control in 17 major US cities. According to her findings, starting points of the housing price bubble in America range from 1996 to 2002, and in most of these cities, bubbles started evolving in 1996 and 1997.

In recent years, there has been a remarkable increase in the publications about the analyses of housing prices and price bubbles in Turkey. Darıcı (2018) investigated the relationships between housing prices, money supply, consumer price index expectation and real exchange rate variables by using autoregressive distributed lag (ARDL) model over the period of 2010-2016, and the results of his study reveal that there is a statistically significant and positive relationship among these variables in general. Kolcu and Yamak (2018) used the ARDL bounds testing approach in their analysis and reveal that the income level has a positive effect on housing prices in the long term. They also concluded that the mortgage loan interest rate has a negative impact on housing prices in the short term; however, there is not any relationship between these variables in the long run. İslamoğlu and Nazlıoğlu (2019) measured the effects of housing demand, housing supply, construction costs, inflation, population and income factors on housing prices in Istanbul, Ankara and Izmir, by using panel data analysis. According to the findings, macroeconomic factors are an important determinant of the housing prices, and the flexibility of housing prices against macroeconomic factors is higher than that of microeconomic factors.

Uysal and Yiğit (2016) studied on the factors that influence the housing demand in Turkey, using VECM over the period of 1975-2015. According to the results of the analysis, there is a positive correlation between housing demand and income per capita, urbanization rate and interest rates variables, while a negative correlation between money supply (M2) and consumer price index (CPI) variables, and housing demand. Also, it has been determined that the most influential variable is the income factor among the determinants of the housing demand. Badurlar (2008) investigated the effects of the national income, money supply, short-term interest rates and exchange rate variables on housing prices in the 1990-2006 period using the VECM method. According to the findings, there are a positive relationship between national income, exchange rates and housing prices, and, on the other hand, a negative relationship between money supply, interest rates and housing prices.

In another study on the housing market in Turkey, Iskenderoglu and Akdag (2019) analyzed housing prices over the period of 2010-2018 for Ankara, Istanbul, Izmir and Turkey in general with the super-augmented Dickey–Fuller (SADF) and generalized super-augmented Dickey–Fuller (GSADF) methods and they found there was a housing price bubble in Istanbul, Izmir and Turkey in general. Similarly, Mandaci and Çağli (2018) studied housing price bubbles in the same areas for the period of 2010-2017 with recursive flexible estimation method, and they concluded that there was a speculative housing bubble in Istanbul, Ankara, Izmir and many other regions in Turkey, especially in the western and the coastal regions of the country.

In addition to the studies suggesting a price bubble in the Turkey housing market, there are also some analyses producing the opposite results. For example, Coskun and Jadevicius (2017) implemented three methodologies covering monthly/annual price-to-income and monthly price-to-rent analysis, Case–Shiller and extended Case–Shiller regressions and right tail augmented Dickey–Fuller test to investigate price bubbles in Istanbul, Ankara and Izmir housing markets over the period of 2010–2014. According to their analysis, there is no evidence to support the existence of a price bubble in the mentioned housing markets. In addition, Afsar and Dogan (2018) reached a similar finding for the 2010-2017 period. They implemented ADF and Generalized SADF tests using real housing price index and rent index data and concluded that there was not a price bubble in the Turkish housing market. In a more recent study, Coskun et al. (2020) analyzed price dynamics and housing bubble risk in Turkish housing market over the 2007-2014 period using ordinary least square (OLS), fully modified OLS, dynamic OLS, Kalman filter and ARIMA model. They used two different house price indexes for two different time periods, 2010-2014 with Central Bank’s House Price Index and 2007-2014 with REIDIN’s House Price Index. They found that there is a long-term cointegration among the housing price index and housing rents, construction costs and housing loan interest rates. Cointegration analysis shows that house prices are in a positive correlation with housing rent and construction costs, and in a negative correlation with real mortgage interest rates. In their study, although not reaching a finding that could be characterized as the housing price bubble, it has been found some cases of overvaluations. Although that situation has not indicated a price bubble, it has been recommended to take measures against the risk of these overvaluations forming a price bubble in the future. To the best of our knowledge, there is no study using LSTM autoencoders to detect housing bubble in the literature.

4 Material and methods

4.1 Study area

In this study, the housing price bubble risk is investigated through the relationship between housing prices and some macroeconomic and microeconomic variables for selected districts of Istanbul, the biggest city in Turkey. We chose Istanbul as our research area both since it is the largest and most dynamic housing market in Turkey, and for a long time, it has been the focus of the price bubble speculations. But Istanbul has a very heterogeneous housing market, and therefore, examining Istanbul as a whole without making a district distinction may cause serious drawbacks in terms of validity and consistency of the results. For example, while the residential construction activities are mostly based on the renovation and reconstruction of the old buildings in most of the old districts such as Kadıköy and Beşiktaş, on the other hand, new housing stocks are increasing more rapidly in the new districts such as Esenyurt and Çekmeköy established in the 2000s. This heterogeneous structure of Istanbul housing market is not limited to those districts and it is possible to make other similar comparisons. For example, while the center of Bakırköy, one of the old districts of Istanbul, has lost its former popularity over time, Ataşehir, which was established in 2008, has become one of the most dynamic districts in the housing sector. Based on these concerns, the scope of this research was not limited only to the general data of Istanbul. Our housing price bubble analysis will be applied for 7 selected districts, namely Beşiktaş, Esenyurt and Başakşehir on the European side, and Kadıköy, Ataşehir, Çekmeköy and Ümraniye on the Anatolian side of Istanbul. While Kadıköy and Beşiktaş are long-established districts where the housing market has a certain stability, the districts of Başakşehir, Esenyurt, Ataşehir, Çekmekoy and Ümraniye have experienced a big dynamism and growth in housing sector during the 2000s. Selected districts are black-colored as shown Fig. 1.

Fig. 1
figure 1

Study areas

4.2 Data description

In this study, we built a dataset of \(N = 7\) districts of Istanbul monthly and quarterly time series frequencies from 2007 June to 2019 December. Our dataset includes following variables: housing price index, housing rent index, return on government debt securities (GDS), USD/TRY exchange rate, BIST price index, monthly deposit interest rates, mortgage interest rates, inflation, building construction cost index, consumer confidence index and GDP volume index.

Table 1 Descriptive statistics for Istanbul monthly period data
Table 2 Descriptive statistics for Istanbul quarterly period data

The Central Bank of the Republic of Turkey (CBRT) has been presenting the city-based and national housing price index starting from 2010. However, this dataset does not go back long enough and does not include the district-based data. The residential housing price index and the residential rent price index data used in this study were taken from the REIDIN Data&Analytics database, which provides data services to the real estate industry and finance sector (https://rebis.reidin.com/tr-TR). This database is containing district-based data and goes back to 2007. Unfortunately, there is not a monthly and district-based housing price index that covers the period prior to 2007, and this situation limits the efficiency of the housing price bubbles analysis in Turkey.

The other data used in the analysis were obtained from various official sources. GDS data are taken from the Ministry of Treasury and Finance website (https://en.hmb.gov.tr/debt-office-statistics); USD/TRY exchange rate, BIST price index, monthly deposit interest rates and mortgage interest rates are taken from the CBRT website (https://evds2.tcmb.gov.tr/index.php?/evds/serieMarket); consumer price index, construction cost index and consumer confidence index data are taken from Turkish Statistical Institute (TURKSTAT) web page (http://www.turkstat.gov.tr/UstMenu.do?metod=temelist); and GDP volume index data are provided from OECD web page (https://stats.oecd.org/OECDStat_Metadata/ShowMetadata.ashx?Dataset=QNA&ShowOnWeb=true&Lang=en). Since the building construction cost index offered by TURKSTAT is based on three separate series, containing 1991–2006, 2005–2017 and 2015–2019 periods, the data have been harmonized and unified based on the last dataset. As an example, Table 1 summarizes the descriptive statistics for monthly period data of Istanbul. Table 2 summarizes the descriptive statistics for quarterly period data of Istanbul. Based on the data of Istanbul, it is observed that the housing price index is correlated with the other variables used in the analysis as shown in Fig. 2.

In the first part of the application, the housing price bubble is investigated through the correlation between the housing price index, housing rent index, and GDS returns, BIST returns, deposit return, foreign currency return, mortgage loan interest rate, consumer price index and consumer confidence index variables by using monthly data. As shown in many studies, there is also a close relationship between housing prices and national income levels and building construction costs. However, national income and building construction cost index data are published quarterly. Therefore, a second analysis is carried out on quarterly data by adding national income and building construction cost index to the previous list used in the first analysis. While the monthly data provide a more detailed and sensitive analysis opportunity, the quarterly variables such as national income and construction cost indexes, which are very closely correlated with housing prices, add a special value to the second analysis.

Fig. 2
figure 2

Correlations between variables of Istanbul dataset

4.3 LSTM autoencoders

Anomaly detection refers to the task of finding/identifying rare events/data points. Some applications include bank fraud detection, tumor detection in medical imaging and errors in written text. A lot of supervised and unsupervised approaches to anomaly detection have been proposed. Some of the approaches include one-class SVMs, Bayesian networks, cluster analysis and neural networks. We use an LSTM autoencoder neural network to detect/predict anomalies (housing bubbles) in Istanbul housing market.

Hochreiter and Schmidhuber (1997) developed long short-term memory (LSTM) in 1997 to solve the vanishing gradient problem. LSTM, which was organized and popularized with the contribution of many people, has a wide usage area. LSTM serves to preserve the error value from different time and layers in the backprop. By providing a more constant error value, it ensures that the learning steps of recurrent networks can continue. It does this by opening a new channel between cause and effect. The difference of the repeating module in the LSTM structure is that instead of a single neural network layer, there are four layers connected in a special way. These layers are also called gates. It is a structure that receives information outside the normal flow. This information can be stored, written to the cell and read.

The cell decides what to store and when it will allow it to read, write or delete. These gates have a network structure and activation function. Just like neurons, it passes or stops the incoming information based on its weight. These weights are calculated during the learning of the recurrent network. With this structure, the cell learns whether to take the data, leave it or delete it. LSTM has different models according to different needs. These are provided by the gates getting their inputs from different places or sending their outputs to different places.

The autoencoder tries to learn data representation of its input. In other words, we recreate the data we provide as input to the neural network in the output layer. So, the input of the autoencoder is the same as the output. The autoencoder is an unsupervised learning model in which explicit tags are not identified when training the dataset. The autoencoder also passes as a self-supervised learning model as it produces its own labels while training the data (Baldi 2012).

Here are the basic steps we use to detect housing bubbles using an autoencoder:

  • Training an autoencoder on normal data (no anomalies)

  • Taking a new data point and try to reconstruct it using the autoencoder

  • If the error (reconstruction error) for the new data point is above some threshold, we label the example as an anomaly.

5 Experimental results and discussion

Housing bubble detection analysis was implemented in Python 3 and tested on a local machine with the following specifications: CPU: Intel Core i7-7700HQ, RAM: 12 GB DDR4-2400, GPU: Nvidia GeForce GTX 950M 2GB GDDR5, OS: Ubuntu 18.04 LTS. We use 90% of the data and train our model on it. We normalize the training data using Min-Mmax normalization (Jain et al. 2005) and apply the same normalization to the test data in preprocessing step. We built LSTM autoencoder model in Keras and its layers, output shapes and number of parameters are listed in Table 3.

We have trained our model for 100 epochs and 10 batch sizes. Activation function is selected as Rectified Linear Unit (ReLU) and adam optimizer is used in our experiments. As an example, we calculate the mean absolute error (MAE) on the training data for Istanbul monthly dataset as shown in Fig. 3. Also, the loss distribution of the training set for Istanbul monthly dataset is illustrated in Fig. 4. We pick a threshold of 0.2, as not much of the loss is larger than that. When the error is larger than that, we declare that example a housing bubble (anomaly is true as specified in Tables 4 and 5). Housing bubble time plot is shown in Figs. 5 and 6 for Istanbul monthly and quarterly datasets, respectively.

According to the results of the first analysis using monthly data, it is seen that the overvaluation of housing prices (see Table 4) has started as of the second half of 2018 in Istanbul-wide and the other selected districts. While the price bubbles were extremely exceptional and short-term until the middle of 2018, they follow a more permanent trend after the second half of 2018, even though showing some fluctuations. Accordingly, it is seen that price bubbles firstly appeared as of July 2018 and this formation generally continues for the next 1 year with some regional differences. As of August 2019, bubbles have disappeared across Başakşehir, Çekmeköy, Esenyurt and Istanbul, but reappeared in Çekmeköy and Esenyurt in the last month of the year. In this period, while a fluctuating trend is observed in Beşiktaş and Ümraniye, bubbles have a permanent trend in Ataşehir and Kadıköy.

As mentioned before, this price bubble formation in the Istanbul housing market should be directly related to the economic slowdown that occurred in the third quarter of 2018. In this period, the housing demand has started to decline and the gap between the housing demand and supply has increased. On the other hand, there was not a significant decline in housing prices and this situation has provided a basis for the formation of a price bubble. The general disappearance of the bubbles in the last quarter of the year is due to the decrease in housing loan interest rates, which were initiated in line with government directives during this period. This mortgage interest rate discount campaign creates a serious demand for housing and consequently prevented the existing prices from fading. This temporary demand growth provided by a government-driven interest rate cut campaign rather than an increase in national income can also be considered as a sign that the danger of the housing bubble has not completely disappeared. This is because in the long term, the sustainability of interest rate cuts that are not supported by main financial and economic indicators is not possible.

The second analysis including the variables of national income and building construction cost index and carrying out with quarterly data shows a similar result for the date when the price bubble first appeared (see Table 5). Accordingly, the price bubble firstly appeared in Beşiktaş, Çekmeköy and Istanbul in the second quarter of 2018, and in the third quarter in other districts. However, unlike the first analysis, it is seen that the price bubbles have never disappeared as of quarterly periods until the end of 2019, and there is still a housing price bubble in all selected districts and throughout Istanbul at the end of 2019. This situation, which is indicating a more serious overvaluation on housing prices compared to the first analysis results, is thought to be directly related to the national income variable included in the second analysis. In other words, the slowdown observed in the national income growth rate in this period had a great impact on this overvaluation.

Table 3 Used autoencoder model and its layers
Fig. 3
figure 3

Training losses for Istanbul monthly dataset

Fig. 4
figure 4

Loss distribution of the training set for Istanbul monthly dataset

6 Conclusion and future work

Housing investment has a very important place among household investment preferences in Turkey. This interest has increased even more in the 2000s with the effect of long-term housing loan opportunities, and housing prices have increased rapidly in this period. As a result of the high level of old residences in the housing stock, the high demand for newer, earthquake-resistant and more qualified housing is also one of the main factors in the increase in real housing prices in these years. In addition, the population growth rate and the increasing immigrant population in the last 8 years are among the factors that feed the housing demand. In these years, rapidly increasing real housing prices were supported by national income growth and high demand, and so, housing prices kept at these high levels for a long time without forming a housing bubble. However, the problems that emerged in economic structure in the following years made high housing prices controversial, and especially with the economic slowdown since the second half of 2018, speculations about the price bubbles in the housing market started to be expressed commonly. Concerns on this issue also have attracted the academic interest in this field, and as a result of this, it is observed that the number of studies investigating the price bubbles in the Turkish housing market has increased in recent years.

Table 4 Overvaluation of housing prices for monthly period data
Table 5 Overvaluation of housing prices for quarterly period data
Fig. 5
figure 5

Housing bubble time plot for Istanbul monthly dataset

Fig. 6
figure 6

Housing bubble time plot for Istanbul quarterly dataset

In this study, unlike the previous ones, the price bubble analysis in Istanbul housing market was made on a district basis. Not only Turkey’s largest city, but also as one of the largest cities in the world, Istanbul has a highly heterogeneous housing market, and so it is thought that the price bubble analysis on regional scale will produce more meaningful results. In our research conducted in 7 districts of Istanbul and throughout the city, we preferred the LSTM autoencoder model, which has not been used much before in such studies. It combines two powerful concepts in deep learning LSTMs and autoencoders. Model can find anomalies in easy way. In the future, we will try to tune the model and/or the threshold to get even better results.

According to the results, it is observed that a housing price bubble has been formed in the selected districts and throughout Istanbul as of the second half of 2018. In the first analysis using monthly data, the price bubble no longer appears from the end of 2019, while in the other analysis carried out with quarterly data, the price bubble continues to exist at the end of 2019. According to another result of the research, the beginning time and development of the price bubble trends may differ regionally within the same city.

Starting from second half of 2019 to the last quarter of 2020, the government has ensured a decreasing trend in interest rates, and implemented housing loan interest discount campaigns through state banks. In this way, housing demand increased rapidly and a probable collapse in the housing sector was prevented. However, housing prices continued to increase rapidly in this period and the price bubble risk has been postponed. Today, the slowdown risk in the Turkish economy is still continuing. The COVID-19 pandemic, which emerged in early 2020 and whose effects are expected to continue throughout 2021, puts a great pressure on national income and employment levels. Considering the possibility of a sharp drop in housing demand in this period, it can be said that the housing price bubble problem will continue to be current for Istanbul throughout 2021. Also, the probability of the COVID-19 pandemic’s effects on household incomes to deepen and result in a widespread default in housing loans is another important risk factor on housing prices in Turkey. In other words, due to the sensitive current economic balances, we believe that the housing price bubble risk in Istanbul should be taken into consideration during 2021.

Undoubtedly, in order to make a more precise and comprehensive price bubble analysis in Istanbul housing market, it is of great importance to expand the analysis to include the other districts of Istanbul. Currently, there are 39 districts in Istanbul, and the inclusion of other districts in the future studies will enable to be interpreted the issue from a wider perspective. On the other hand, it should be noted that, the absence of a housing price index data extending older than 2007 is an important factor limiting the effectiveness of the housing market analyses in Turkey. The creation of the district-based price indexes dating back to at least the 1990s in collaboration with universities and the housing sector, will make a significant contribution to the housing pricing studies. In addition, classifying the houses according to their price levels and investigating the price bubbles on the different housing segments may produce more detailed results in future studies.