python - Python statsmodel ARIMA 预测版本之间的差异
问题描述
我有一组训练的乘客:
train['Passengers']
Month
1949-01-01 112
1949-02-01 118
1949-03-01 132
1949-04-01 129
1949-05-01 121
...
1959-08-01 559
1959-09-01 463
1959-10-01 407
1959-11-01 362
1959-12-01 405
Freq: MS, Name: Passengers, Length: 132, dtype: int64
现在使用 statsmodel 我想实现 ARIMA(8,1,1)。
但是,statsmodels.tsa.arima.model.ARIMA 似乎预测的值与已弃用的版本 statsmodels.tsa.arima_model.ARIMA 不同。
statsmodels.tsa.arima.model.ARIMA:
from statsmodels.tsa.arima.model import ARIMA
arima = ARIMA(train['Passengers'], order=(8,1,1))
arima_result = arima.fit()
arima_result.predict(start=train.index[1], end=train.index[-1])
Month
1949-02-01 112.034073
1949-03-01 119.751782
1949-04-01 135.651835
1949-05-01 124.246608
1949-06-01 116.279857
...
1959-08-01 542.722017
1959-09-01 481.743123
1959-10-01 413.868022
1959-11-01 354.078873
1959-12-01 355.815461
Freq: MS, Name: predicted_mean, Length: 131, dtype: float64
statsmodels.tsa.arima_model.ARIMA:
from statsmodels.tsa.arima_model import ARIMA
arima = ARIMA(train['Passengers'], order=(8,1,1))
arima_result = arima.fit()
arima_result.predict(start=train.index[1], end=train.index[-1])
Month
1949-02-01 2.532206
1949-03-01 3.585345
1949-04-01 6.018756
1949-05-01 -2.077600
1949-06-01 -1.577707
...
1959-08-01 -10.896945
1959-09-01 -86.790586
1959-10-01 -49.189211
1959-11-01 -50.916200
1959-12-01 -3.487137
Freq: MS, Length: 131, dtype: float64
这怎么可能?以及如何使用新版本恢复对已弃用版本的预测?
解决方案
推荐阅读
- javascript - 输入字段中值更改的 CSS 更改。jQuery
- mysql - phpMyAdmin 错误 #1210
- dockerfile - Concourse 尝试使用错误的 sha256 摘要拉取 docker 图像并失败
- angularjs - chrome 更新到 66 版后应用程序无法运行,但在 Firefox 和 Edge 中运行
- python - 无论我如何尝试,pyinstaller 都无法处理
- python - 如何划分复杂的列表
- twig - 树枝模板中的递归宏调用
- elasticsearch - 嵌套(非数组)字段上的 Elasticsearch 聚合
- windows - 为什么调用运算符 (&) 和 Invoke-Expression 对相同的输入产生不同的结果?
- c# - 访问 Web API 方法时 EF 代码优先并发