【问题标题】:Comparison of results from statsmodels ARIMA with original datastatsmodels ARIMA 的结果与原始数据的比较
【发布时间】:2015-07-18 10:34:32
【问题描述】:

我有一个包含季节性成分的时间序列。我为 statsmodels ARIMA 安装了

model = tsa.arima_model.ARIMA(data, (8,1,0)).fit()

例如。现在,我知道 ARIMA 会区分我的数据。如何比较来自

的结果
prediction = model.predict()
fig, ax = plt.subplots()
data.plot()
prediction.plot()

由于数据将是原始数据并且预测有所不同,因此平均值在 0 左右,与数据的平均值不同?

【问题讨论】:

  • 查看预测文档字符串和typ 关键字。
  • 谢谢。现在看起来有点明显,但是当我阅读文档时,它并不是那么简单。也许在文档上提供更多指示会有所帮助?
  • 另外,这个问题似乎已经出现在邮件列表中:groups.google.com/forum/?hl=en#!topic/pystatsmodels/QIhYf9XCyd8

标签: python statsmodels


【解决方案1】:

正如documentation 所示,如果将关键字typ 传递给predict 方法,则答案可以显示在原始预测变量中:

typ : str {‘linear’, ‘levels’}

    ‘linear’ : Linear prediction in terms of the differenced endogenous variables.
    ‘levels’ : Predict the levels of the original endogenous variables.

所以电话会是

model = tsa.arima_model.ARIMA(data, (12,1,0)).fit()
arima_predict = model.predict('2015-01-01','2016-01-01', typ='levels')

【讨论】:

    猜你喜欢
    • 2021-03-01
    • 1970-01-01
    • 2012-04-29
    • 2017-12-02
    • 2016-08-14
    • 2018-01-17
    • 2015-12-22
    • 1970-01-01
    • 2011-10-29
    相关资源
    最近更新 更多