Search code examples
time-seriesstatsmodelsautoregressive-models

What does the start_ar_lags attribute do in an ARMA model?


I am using the ARMA model from the statsmodel library.

It have seen this parameter start_ar_lags set when the error:

ValueError: The computed initial AR coefficients are not stationary
You should induce stationarity, choose a different model order, or you can
pass your own start_params. 

One example had non-stationary data and after getting this error they added start_ar_lags parameter.

model_ar_6_ma_6 = ARMA(df.market_value, order=(6,6))
results_ar_6_ma_6 = model_ar_6_ma_6.fit(start_ar_lags = 11)

This worked, but what does start_ar_lags do. Does the ARMA model still use 6 and 6 lags for the AR and MA respectively.

The documentation says:

 If start_ar_lags is not None, fits an AR process with a lag length equal to start_ar_lags.

Does it actually change the number of lags in the model?


Solution

  • start_ar_lags is an argument of _fit_start_params_hr method which is used to get starting parameters for fit. This method first fits an AR process of order that is selected via best BIC if start_ar_lags is None. If start_ar_lags is not None, it fits an AR process of order start_ar_lags. Then, using residuals of this AR fit, it fits an ARMA process of order (p, q) that you specified in the ARMA() constructor, and that is used as a first guess at the starting parameters, and the overall model fit continues from here.

    So no, it does not affect your model order.