pythonstatsmodelsforecastingarimapmdarima

ARIMA Model Predicting a straight line for my temperature data


I have a temperature dataset of 427 days(daily temperature data) I am training the ARIMA model for 360 days and trying to predict the rest of the 67 days data and comparing the results. While fitting the model in test data I am just getting a straight line as predictions, Am i doing something wrong? `

from statsmodels.tsa.arima.model import ARIMA
model = ARIMA(train['max'],order=(1,1,2),)
results = model.fit()
results.summary()
start = len(train)
end = len(train) + len(test) -1
predictions= pd.DataFrame()
predictions['pred'] = results.predict(start=start, end=end, typ='levels').rename('ARIMA(1,1,1) Predictions')

enter image description here


Solution

  • Your ARIMA model uses the last two observations to make a prediction, that means:

    The prediction is based on previous predictions, and that means that forecasting errors will negatively impact new predictions. Imagine your prediction deviates only 1% for each time step, the forecasting error will become bigger and bigger the more time steps you try to predict. In such cases, the predictions often form a straight line at some point.

    If you use an ARIMA(p, d, q) model, then you can forecast a maximum of q steps into the future. Predicting 67 steps into the future is a very far horizon, and ARIMA is most likely not able to do that. Instead, try to predict only the next single or few time steps.