Time Series Prediction – Addressing Time Series Prediction Shifted in Time

arimapythontime series

I am using an AR(p) model and an ARIMA model to produce a time series of temperatures (with StatsModels for Python). I use a rolling forecast (I mean: I train the model on a training set, make a prediction, then the training set is increased with the new (exact) observation taken from the test set, the model is retrained on the updated training set, then I make a new prediction and so on).
With an AR model and an ARIMA model I obtain predictions that are clearly shifted with respect to the observations. First with the AR model I obtain:

enter image description here

then with the ARIMA model:
enter image description here

where the blue color is for the observations and the red color for the predictions.
Is it normal behavior ? Is there a way to correct the shift ?

Best Answer

This is the expected behavior. AR and ARMA use only past information. If there are fluctuations, then we are always behind. Without additional information that can be used in forecasting we cannot do much better.

For example if this is the forecasting the daily weather.
Based on todays data, the best forecast for tomorrow will be that the weather is close to today. If the temperature is increasing over several days and we get sunny days, then we will underestimate each of these days. If the weather turns bad over several days, then we will always overestimate how good the weather will be.

Now suppose the plots are the hourly temperature over a day.
In this case we can use the time of day to model and forecast that the temperature is on average lower in the night, higher during the day, increasing after sunrise and decreasing after sunset. Using this seasonal pattern either with a deterministic part like dummies or seasonal polynomials or by using a seasonal ARIMA, we can capture to daily pattern and avoid, for example, lagging behind in our forecast as the temperature increases between 8 am and 10 am.