0

I want to forecast multiple steps ahead using ARIMA. I am deriving my hyper-params with a grid search.

I want to achieve multiple one-step forecasts. However, I do not want a rowling forecast that uses new actual observations, but I want the model to only rely on data in a test set and its own predictions (if predictions are well into the future).

Can anyone tell me what the difference between these three implementations is and if any of them matches my requirements?

no 1

In the first example, the whole data set (df = item) is passed to the model. Does this mean that the model is using actuals as lags instead of predictions at some point?

preds =item[0:len_train]
model = ARIMA(item, (4, 2, 1))
fit = model.fit()
for i in range(0,len_test):
    pred = fit.predict(len_train+i,len_train+i)
    preds = preds.append(pred)

no 2

train, test = item[0:len_train], item[len_train:]
model = ARIMA(train, order=(4,2,1))
model_fit = model.fit(displ=False)
forecast = model_fit.predict(start=len_train, end=len(item)-1, dynamic=False)

Predictions seem to saturate at some point; it seems that the model is not reusing its own predictions.

no 3

This is an attempt to fit a new model that incorporates the new data after each one-step forecast. However, I do not want this. If I append predictions instead of actual observations to the 'history' forecasts are becoming quickly very extreme.

print('Printing Predicted vs Expected Values...')
 for t in range(len(test)):
   model = ARIMA(history, order=(4,2,1))
   model_fit = model.fit(disp=0)
   output = model_fit.forecast()
   print('output', output)
   yhat = output[0]
   predictions.append(float(yhat))
   obs = test.values[t]
   history.append(obs)
   print('predicted=%f, expected=%f' % (np.exp(yhat), np.exp(obs)))

Thanks a lot!

Lio
  • 3
  • 4
  • What do you mean by "multiple one-step forecasts"? Do you want to retrain your model after a prediction with training data and your predictions or traingin data and your true test data? Or do you just want to update your model without retraining it? – Arne Decker Dec 29 '21 at 14:54
  • I would like to feed the new prediction to the model and retain the model on the train data plus prediction. What do you mean by updating the model without retraining? – Lio Dec 30 '21 at 13:30
  • Okay, I see. How many steps into the future do you want to predict before retaining the model? Because "retraining" means that you create a new model with the data, updating means that you just append data without retraining. – Arne Decker Jan 11 '22 at 13:07

0 Answers0