Я пытаюсь спрогнозировать временные ряды с ARIMA.Как видно из графика, прогноз на шаг впереди ожидаемых значений.Я читал в некоторых других темах, что такое поведение ожидается, но как?Как я могу синхронизировать?![enter image description here](https://i.stack.imgur.com/Eadzn.png)
Код, который я использовал:
history = [x for x in train]
predictions = list()
for t in range(len(test)):
model = ARIMA(history,order=(2, 2, 1))
model_fit = model.fit(disp=0)
output = model_fit.forecast(alpha=0.05)
yhat = output[0]
predictions.append(yhat)
obs = test[t]
history.append(obs)
print('predicted=%f, expected=%f' % (yhat, obs))
rmse = sqrt(mean_squared_error(test, predictions))
print('Test RMSE: %.3f' % rmse)
# plot
plt.plot(test, color='blue')
plt.plot(predictions, color='red')
plt.show()