简体   繁体   中英

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. For example, for the AR object, we have the following function definitions:

  • 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 's first parameter is the parameters to the constructor of AR ; it doesn't make sense that these once again appear in the parameter for predict . They also appear for the constructors for ARIMA and ARMA . 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. This the pattern that we follow.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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