# RECORD 41c05e4c190bfd812f576bb4bc53a0c147331a7d # TITLE: Accounting for Spatial Autocorrelation in Algorithm-Driven Hedonic Models: A Spatial Cross-Validation Approach # YEAR: 2022.0 VENUE: Journal of real estate finance and economics DOI: 10.1007/s11146-022-09915-y # AUTHORS: Juergen Deppner; Marcelo Cajias # PAGES: 39 CANDIDATE TABLE PAGES (1-based): [32, 33] # ABSTRACT: Data-driven machine learning algorithms have initiated a paradigm shift in hedonic house price and rent modeling through their ability to capture highly complex and non-monotonic relationships. Their superior accuracy compared to parametric model alternatives has been demonstrated repeatedly in the literature. However, the statistical independence of the data implicitly assumed by resampling-based error estimates is unlikely to hold in a real estate context as price-formation processes in property markets are inherently spatial, which leads to spatial dependence structures in the data. When performing conventional cross-validation techniques for model selection and model assessment, spatial dependence between training and test data may lead to undetected overfitting and overoptimistic perception of predictive power. This study sheds light on the bias in cross-validation errors of tree-based algorithms induced by spatial autocorrelation and proposes a bias-reduced spatial cross-validation strategy. The findings confirm that error estimates from non-spatial resampling methods are overly optimistic, whereas spatially conscious techniques are more dependable and can increase generalizability. As accurate and unbiased error estimates are crucial to automated valuation methods, our results prove helpful for applications including, but not limited to, mass appraisal, credit risk management, portfolio allocation and investment decision making. ===== PAGE 1 (score 3, numeric-paren 0, table-words 0, var-words 3) ===== Vol.:(0123456789) The Journal of Real Estate Finance and Economics (2024) 68:235–273 https://doi.org/10.1007/s11146-022-09915-y 1 3 Accounting for Spatial Autocorrelation in Algorithm‑Driven Hedonic Models: A Spatial Cross‑Validation Approach Juergen Deppner1   · Marcelo Cajias1,2  Accepted: 17 June 2022 / Published online: 13 July 2022 © The Author(s) 2022 Abstract Data-driven machine learning algorithms have initiated a paradigm shift in hedonic house price and rent modeling through their ability to capture highly complex and non-monotonic relationships. Their superior accuracy compared to parametric model alternatives has been demonstrated repeatedly in the literature. However, the statistical independence of the data implicitly assumed by resampling-based error estimates is unlikely to hold in a real estate context as price-formation processes in property markets are inherently spatial, which leads to spatial dependence struc- tures in the data. When performing conventional cross-validation techniques for model selection and model assessment, spatial dependence between training and test data may lead to undetected overfitting and overoptimistic perception of predic- tive power. This study sheds light on the bias in cross-validation errors of tree-based algorithms induced by spatial autocorrelation and proposes a bias-reduced spatial cross-validation strategy. The findings confirm that error estimates from non-spatial resampling methods are overly optimistic, whereas spatially conscious techniques are more dependable and can increase generalizability. As accurate and unbiased error estimates are crucial to automated valuation methods, our results prove helpful for applications including, but not limited to, mass appraisal, credit risk manage- ment, portfolio allocation and investment decision making. Keywords  Hedonic modeling · Machine learning · Spatial autocorrelation · Spatial cross-validation · Mass appraisal · Automated valuation models * Juergen Deppner juergen.deppner@irebs.de Marcelo Cajias marcelo.cajias@irebs.de 1 University of Regensburg, IRE|BS International Real Estate Business School, Universitätsstraße 31, 93053 Regensburg, Germany 2 PATRIZIA AG, Fuggerstraße 26, 86150 Augsburg, Germany ===== PAGE 32 (score 44, numeric-paren 27, table-words 2, var-words 13) ===== 266 J. Deppner, M. Cajias 1 3 Appendix 1 Table 6   OLS Regression Output Panel A: OLS Model including Spatial Controls Variable Estimate Std. Error t-value p value Significance (Intercept) −74.91 5.92 −12.65 0.00 *** Continuous   Living Area [log] 0.80 0.01 81.98 0.00 ***   Age [years] 0.00 0.00 −20.11 0.00 ***   Age squared 0.00 0.00 19.59 0.00 ***   Entry date [years] −0.02 0.01 −2.12 0.03 *   ­Latitude1 1.45 0.12 12.17 0.00 ***   ­Longitude1 0.67 0.06 11.68 0.00 *** Discrete   Rooms 0.04 0.00 10.05 0.00 ***   Floor 0.00 0.00 5.29 0.00 *** Binary [1 = yes, 0 = no]   Bathtub −0.04 0.00 −9.78 0.00 ***   Refurbished 0.02 0.01 3.03 0.00 **   Built-in kitchen 0.11 0.01 21.65 0.00 ***   Balcony 0.02 0.00 3.84 0.00 ***   Parking 0.03 0.01 4.88 0.00 ***   Elevator 0.04 0.01 7.64 0.00 ***   Terrace 0.04 0.01 5.99 0.00 *** Distances   NUTS centroid [km] −0.02 0.00 −13.02 0.00 ***   Bakery [km] −0.01 0.01 −1.22 0.22   Bar [km] −0.02 0.00 −3.73 0.00 ***   Biergarten [km] −0.05 0.00 −14.71 0.00 ***   Café [km] −0.02 0.01 −2.11 0.03 *   School [km] −0.03 0.01 −2.35 0.02 *   Supermarket [km] 0.02 0.01 1.20 0.23   Bus station [km] −0.04 0.00 −17.16 0.00 *** Panel B: OLS model excluding Spatial Controls (Intercept) 3.12 0.04 83.32 0.00 *** Continuous   Living Area [log] 0.84 0.01 76.62 0.00 ***   Age [years] 0.00 0.00 −18.16 0.00 ***   Age squared 0.00 0.00 21.45 0.00 ***   Entry date [years] −0.02 0.01 −2.25 0.02 * ===== PAGE 33 (score 34, numeric-paren 8, table-words 6, var-words 14) ===== 267 1 3 Accounting for Spatial Autocorrelation in Algorithm‑Driven… 1. As modeling choices may differ depending on whether analysis or prediction is the main objective of a study, we concentrate primarily on prediction and do not wish to draw any causal inference or conclusions of the market under investigation. 2. Although the use of asking rents can been criticized since they may deviate from actual contract rents, multiple listing systems (MLS) provide a valuable data source for statistical learning applications due to their high frequency of occurrence and timely availability and have been repeatedly used in the algorithmic hedonic literature (e.g., Chiarazzo et al., 2014; Park and Bae, 2015; Baldominos et al., 2018; Gröbel and Thomschke, 2018; Hu et al., 2019; Pérez-Rave et al., 2019; Pace and Hayunga, 2020; Rico-Juan and Taltavull de La Paz, 2021). Considering vacancy rates for dwellings in Frankfurt well below 1 %, we can follow the rationale of Gröbel (2019) and assume that renters are price takers, such that there should be no notable differences between asking and contract rents. Besides that, deviations between asking and contract rents “[…] are not expected to lead to an error bias”, especially when hedonic characteristics are controlled for, as stated by Cajias (2018). We hence do not see any reason to question the validity of asking rents, especially in view of the objective of our study. 3. The systematic variation of rent formation processes across space should not introduce bias into cross-validation errors since machine learning algorithms do not assume fixed hedonic pricing coefficients but have the flexibility to differentiate between spatially heterogeneous environments. In this study, spatial heterogeneity is, therefore, put aside and the focus lies on spatial autocorrelation only. 4. Evidently, housing data not only exhibit high levels of spatial but also temporal dependence when pooled across time (Pace et al., 2000). In this study, we leave temporal aspects aside for future research and focus solely on space. This table reports the ordinary least squares (OLS) regression outputs for the model including spatial controls in panel A and the model excluding spatial controls in panel B. The dependent variable is the log(rent), independent variables are listed in the left column accordingly. Significance codes: p < 0.001 ‘***’, p < 0.01 ‘**’, p < 0.05 ‘*’, p < 0.1 ‘.’, p > 0.1 “. Std. Error: standard error. Panel A: F-statistic 2245.00 (p value: 0.0000), AIC -4450.02, BIC -4276.96. Panel B: F-statistic 2968.00 (p value: 0.0000), AIC -2592.44, BIC -2488.61 1 The coefficients of the coordinates indicate that the rent in the study area increases on average ceteris paribus by 67% for one degree of longitude to the east and analogous by 145% for on the degree of lati- tude to the north. We acknowledge that, in a linear context, interpretation of coordinates is very abstract and has limitations such as anisotropy across space. A more practical interpretation is that, in general, rents tend to increase towards the east/north of the city Table 6   (continued) Panel A: OLS Model including Spatial Controls Variable Estimate Std. Error t-value p value Significance Discrete   Rooms 0.03 0.00 6.32 0.00 ***   Floor 0.01 0.00 6.43 0.00 *** Binary [1 = yes, 0 = no]   Bathtub −0.05 0.00 −10.78 0.00 ***   Refurbished 0.03 0.01 4.53 0.00 ***   Built-in kitchen 0.15 0.01 26.57 0.00 ***   Balcony 0.02 0.01 2.94 0.00 **   Parking 0.01 0.01 1.52 0.13   Elevator 0.10 0.01 16.78 0.00 ***   Terrace 0.03 0.01 4.06 0.00 *** ===== PAGE 34 (score 10, numeric-paren 0, table-words 2, var-words 6) ===== 268 J. Deppner, M. Cajias 1 3 5. One limitation of the selected k-means clustering cross-validation strategy (Brenning, 2012) is that full independence between training and test data can only be achieved if the distance between each pair of training and test observation exceeds the spatial autocorrelation range (Brenning, 2005; Le Rest et al., 2014). This is unlikely to be the case for all observations in our resampling instantiation, especially for data points located at the borders of the spatial clusters. Nonetheless, we believe that the number of observations in each test fold is large enough to counteract structural overfitting, such that the impact on aggregated results should be minor. Following the suggestion of Roberts et al. (2017), we refrain from further reducing the number of k folds in the cross-validation procedure since this would withhold too much information during training and may introduce unnecessary extrapolation into the models. 6. All analyses and model estimations were executed using the open-source statistical programming language R under the version 4.0.4 (R Core Team, 2021). All machine learning algorithms and resampling techniques were employed using the mlr3 framework implemented by Lang et al. (2019), which is an ecosystem that facilitates a standardized interface to many existing packages in the R environment. To obtain reproducible results and to ensure that the instantiation of the resampling calls do not vary between the different models, which could distort the results, all outputs were produced with the same random number generator using the set.seed function in R. 7. Estimations were executed on a standard 1.80GHz processor with four cores, eight logical processors and eight gigabytes of RAM using a 64-bit Windows operating system. After parallelization, the in-sample estimation of the random forest required between 11 and 20 hours for each of the four estimated resampling alternatives, whereby spatial tuning in the inner resampling loop reduced estimation time by up to 43%. The much more efficient extreme gradient boosting algorithm needed only about 3 to 3.5 hours respectively with the spatial tuner being slightly less time-consuming. During the one quarter ahead prediction, where cross-validation only needs to be performed for hyperparameter tuning in the inner loop, estimation time dropped to 3.5 hours for the bagging algorithm and to approximately 30 minutes for the boosting algorithm. The spatial linear models required less than 30 minutes each and the least squares estimator less than a second. Estimation time was significantly lower for the alternative model specification B for all models. Acknowledgments  The authors especially thank PATRIZIA AG for contributing to this study. All state- ments of opinions are those of the authors and do not necessarily reflect the opinion of PATRIZIA AG or its associated companies. Authors’ Contributions  All authors contributed to the study conception and design, analysis, and material preparation. All authors read and approved the final manuscript. Funding  Open Access funding enabled and organized by Projekt DEAL. Data Availability  The data were provided by PATRIZIA AG and are confidential. Code Availability  Custom code using R open-source software and packages (R Core Team, 2021). Declarations  Conflicts of Interest/Competing Interests  The authors have no conflicts of interest to declare that are relevant to the content of this article. All authors certify that they have no affiliations with or involvement in any organiza- tion or entity with any financial interest or non-financial interest in the subject matter or materials discussed in this manuscript. The authors have no financial or proprietary interests in any material discussed in this article. Open Access  This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://​creat​iveco​mmons.​org/​licen​ses/​by/4.​0/.