简体   繁体   English

改进 python ARIMA 预测

[英]Improve python ARIMA prediction

I'm working on an ARIMA model in python for the first time and the predictions don't really make any sense.我第一次在 python 中研究 ARIMA model 并且预测没有任何意义。 These are my values .这些是我的价值观

With auto_ARIMA i got the p, d and q values of 1, 1, 2.使用 auto_ARIMA,我得到了 1、1、2 的 p、d 和 q 值。

model = ARIMA(train, order=(1, 1, 2)
fitted = model.fit(disp=0)
print(fitted.summary())

So I create the model and get this summary.所以我创建了 model 并得到了这个摘要。 I then split them into a train and test set, so I can validate the prediction and do the forecast:然后我将它们分成一个训练集和测试集,这样我就可以验证预测并进行预测:

fc, se, conf = fitted.forecast(len(test), alpha=0.05)  # 95% conf
fc_series = pd.Series(fc, index=test.index)
lower_series = pd.Series(conf[:, 0], index=test.index)
upper_series = pd.Series(conf[:, 1], index=test.index)

And get this plot .并得到这个plot

I tested with other p, d, q values and didn't get a better result.我用其他 p、d、q 值进行了测试,但没有得到更好的结果。 The forecast line is always straight, never goes up and down.预测线总是笔直的,从不上下。 Why is this?为什么是这样? How can I improve the result?我怎样才能改善结果? Let me know if you need more information or plots.如果您需要更多信息或情节,请告诉我。

This is usually due to the lack of strongly pronounced data features like seasonality or trend.这通常是由于缺乏明显的数据特征,如季节性或趋势。 Then ARIMA cannot handle the future properly and falls back to the average of data values.然后 ARIMA 无法正确处理未来并回退到数据值的平均值。

I had a similar issue with my data and was able to improve the result by splitting it into smaller chunks.我的数据也有类似的问题,并且能够通过将其分成更小的块来改进结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM