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!