hlin117
hlin117

Reputation: 22308

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:

(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.

Upvotes: 6

Views: 6747

Answers (1)

jseabold
jseabold

Reputation: 8281

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()

Upvotes: 5

Related Questions