r/MachineLearning • u/moucha10 • 3d ago
Project Time Series Lag Problems [P]
Hi everyone, I'm having an issue with lags on time series models predicting U.S. housing prices (FHFA HPI as the target) and I can't figure out where they're coming from (I'm no expert by any means). I've hand-built simpler models, but I'm using Claude Code for this project because it's larger. I've collected over 600 features: global, national (40 countries), and metro (393 U.S. metros). The attached table shows the different models we've tried - starting simple'ish and moving to building our own hierarchical transformer. The problem (the attached charts show an example) is that all the forecasts significantly lag the actual observations - ON ALL THE DIFFERENT MODELS by roughly the same amount. A 1-year forecast lags actuals by about 4-5 quarters. A 2-year forecast lags actuals by about 8-9 quarters. Same with 3- and 5-year (charts attached). On all runs. So the lag is pretty much the exact forecast horizon. I've experienced late calls on turns before, but nothing so consistent across all model types. So I'm pretty sure I'm doing something wrong, but don't know what. Any ideas or help would be appreciated.




2
u/martinetmayank 1d ago
1
u/martinetmayank 1d ago
Well, looking at the graph my intuition would be that 2 macro events which I told you. Before the 08 crisis, loans were very cheap (so a peak in 06-07) in US and then 08, Leehman Brothers collapsed which took industry with it. Interest rates rose, so a dip (in 09-10)
In Covid, i think the Fed has reduced interest rates again, so as to increase consumption, which shows an in increase just after Covid.
Again, I'm not from US, but these are my hypothesis. Please do research on this angle as well. If true, No model could have predicted this.
1
u/patcpsc 20h ago edited 5h ago
A few things leap out:
- 4-5 quarters is roughly a year. 8-9 quarters is roughly 2 years. A simple model f(x) = x (i.e. the best estimate of the value 1 or 2 years out is the current value) would probably outperform many of these models. I could be misreading your charts - but I suspect your models are finding equivalents of f(x) = x.
- the time series is non stationary, very autocorrelated. Typical approach in this instance is to first difference the result and forecast the growth rate and not the level. So take your dependent [n.b. edit] variable i.e. the price index, and transform it y_t -> (y_t - y_{t-1})/y_{t-1}, either at monthly or quarterly levels.
- have a look at ARMA models. Econometrics people would start there, and my guess is you'd get better results from a simple ARMA model. Maybe then a simple linear regression of the current index growth from previous period growth and a couple of key macro factors, e.g. gdp growth, interest rates. Once you've got some traction there I'd start playing with the more complex models.