简体   繁体   English

python statsmodels:用于预测arima模型功能的“params”参数

[英]python statsmodels: “params” parameter for predict function of arima models

ARIMA ( statsmodels.tsa.arima_model.ARIMA ), AR ( statsmodels.tsa.ar_model.AR ), and ARMA ( statsmodels.tsa.arima_model.ARMA ) in statsmodels all take in the parameters of their model in their predict method. 统计模型中的ARIMA( statsmodels.tsa.arima_model.ARIMA ),AR( statsmodels.tsa.ar_model.AR )和ARMA( statsmodels.tsa.arima_model.ARMA )都在其predict方法中接受其模型的参数。 For example, for the AR object, we have the following function definitions: 例如,对于AR对象,我们有以下函数定义:

  • AR(endog, dates=None, freq=None, missing='none')[source]
  • fit([maxlag, method, ic, trend, ...])
  • predict(params[, start, end, dynamic])

( Link to documentation here ) 链接到这里的文档

I'm actually very confused about the parameter choices for predict . 我实际上对predict的参数选择非常困惑。 predict 's first parameter is the parameters to the constructor of AR ; predict的第一个参数是AR构造函数的参数; it doesn't make sense that these once again appear in the parameter for predict . 这些再次出现在predict参数中是没有意义的。 They also appear for the constructors for ARIMA and ARMA . 它们也出现在ARIMAARMA的构造函数中。 Can someone answer why this parameter exists? 有人可以回答为什么这个参数存在?

For what its worth, I don't have much background in time series analysis, so perhaps there is some functionality that is exposed when reusing parameters. 对于它的价值,我没有太多的时间序列分析背景,所以也许在重用参数时会暴露一些功能。 Otherwise, this parameter is a nuisance. 否则,此参数是令人讨厌的。

I answered your question on the issue tracker here . 我在这里回答了关于问题跟踪器的问题。 You want to call predict on the results object returned from fit. 您希望对fit返回的结果对象调用predict。 This the pattern that we follow. 这是我们遵循的模式。

model = sm.tsa.ARMA(y, (2, 2))
results = model.fit()
results.predict()

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

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