python statsmodels: "params" parameter for predict function of arima models
Asked Answered
F

1

6

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.

Fouquiertinville answered 27/7, 2015 at 23:49 Comment(0)
H
5

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()
Hagai answered 28/7, 2015 at 1:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.