Im trying to build a rolling multistep ARIMA forecast. But I cant combine the outputs from the forecast with newer ones.
from pandas import read_csv
from statsmodels.tsa.arima_model import ARIMA
data = read_csv('data_woc.csv', header=0, squeeze=True)
size = 4763
X = data.iloc[:,1:2]
train, test = X[0:size], X[size:len(X)]
history = train
predictions = list()
error = list()
original = list()
for t in range(len(test)):
model = ARIMA(history, order=(2, 1, 0))
model_fit = model.fit(disp=0)
output = model_fit.forecast(steps=7)[0]
predictions = predictions + output
obs = test[t:t + 2]
history = history + obs
print(model_fit.summary())
running it would throw an error
Traceback (most recent call last): File "C:/Users/Usama/Documents/Thesis - Model/ARIMA2_7.py", line 45, in predictions = predictions + output ValueError: operands could not be broadcast together with shapes (0,) (7,)