[英]Statsmodel ARIMA prediction mismatch
I have written the below code to forecast data using ARIMA of stats models,but my results are not matching with the actual data and the predicted values become almost constant after first few predictions giving a straight horizontal line on graph. 我已经编写了以下代码来使用ARIMA的统计模型进行数据预测,但是我的结果与实际数据不匹配,并且在前几次预测在图形上给出一条水平直线后,预测值几乎保持不变。
And if the prediction is for 2nd differencing order because i have used d=2,how can i get the prediction for original data for the same model. 如果由于我使用了d = 2而预测是用于二阶微分阶数,那么对于相同模型,我如何获得原始数据的预测。
arima_mod = sm.tsa.ARIMA(df, (1,2,0)).fit()
print(arima_mod.params)
print(arima_mod.summary())
predict_workshop = arima_mod.predict('2011-04-01', '2011-05-30',dynamic=True)
print(predict_workshop)
Actual data 实际数据
2011-04-01 356.839
2011-04-02 363.524
2011-04-03 332.864
2011-04-04 336.228
2011-04-05 264.749
2011-04-06 321.212
2011-04-07 384.382
2011-04-08 273.250
2011-04-09 307.062
2011-04-10 326.247
2011-04-11 222.521
2011-04-12 135.326
2011-04-13 374.953
2011-04-14 329.583
2011-04-15 358.853
2011-04-16 343.169
2011-04-17 312.086
2011-04-18 339.302
2011-04-19 300.534
2011-04-20 367.166
2011-04-21 178.670
2011-04-22 320.823
2011-04-23 349.995
2011-04-24 323.120
2011-04-25 331.665
2011-04-26 352.993
2011-04-27 359.253
2011-04-28 308.281
2011-04-29 329.357
2011-04-30 301.873
predicted value 预测值
2011-04-01 -50.693560
2011-04-02 30.715553
2011-04-03 -19.081318
2011-04-04 11.378766
2011-04-05 -7.253263
2011-04-06 4.143701
2011-04-07 -2.827670
2011-04-08 1.436625
2011-04-09 -1.171787
2011-04-10 0.423744
2011-04-11 -0.552221
2011-04-12 0.044764
2011-04-13 -0.320404
2011-04-14 -0.097036
2011-04-15 -0.233667
2011-04-16 -0.150092
2011-04-17 -0.201214
2011-04-18 -0.169943
2011-04-19 -0.189071
2011-04-20 -0.177371
2011-04-21 -0.184528
2011-04-22 -0.180150
2011-04-23 -0.182828
2011-04-24 -0.181190
2011-04-25 -0.182192
2011-04-26 -0.181579
2011-04-27 -0.181954
2011-04-28 -0.181724
2011-04-29 -0.181865
2011-04-30 -0.181779
A little hint. 一点提示。 You should include a dummy intervention variable at period 11,12, 21. There is no need to double difference this model.
您应该在期间11,12,21包括一个虚拟干预变量。无需将此模型加倍加倍。 Just an intercept and 3 intervention variables would work.
只需拦截和3个干预变量即可。 Y(T) = 332.20
Y(T)= 332.20
+[X1(T)][(- 196.87 )] :PULSE 12 +[X2(T)][(- 153.53 )] :PULSE 21 +[X3(T)][(- 109.68 )] :PULSE 11 + + [A(T)] + [X1(T)] [(-196.87)]:PULSE 12 + [X2(T)] [(-153.53)]:PULSE 21 + [X3(T)] [(-109.68)]:PULSE 11 + + [在)]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.