statsmodels.tsa.stattools.arma_order_select_ic

statsmodels.tsa.stattools.arma_order_select_ic(y, max_ar=4, max_ma=2, ic='bic', trend='c', model_kw=None, fit_kw=None)[source]

Compute information criteria for many ARMA models.

Parameters:
yarray_like

Array of time-series data.

max_arint

Maximum number of AR lags to use. Default 4.

max_maint

Maximum number of MA lags to use. Default 2.

icstr, list

Information criteria to report. Either a single string or a list of different criteria is possible.

trendstr

The trend to use when fitting the ARMA models.

model_kwdict

Keyword arguments to be passed to the ARMA model.

fit_kwdict

Keyword arguments to be passed to ARMA.fit.

Returns:
Bunch

Dict-like object with attribute access. Each ic is an attribute with a DataFrame for the results. The AR order used is the row index. The ma order used is the column index. The minimum orders are available as ic_min_order.

Notes

This method can be used to tentatively identify the order of an ARMA process, provided that the time series is stationary and invertible. This function computes the full exact MLE estimate of each model and can be, therefore a little slow. An implementation using approximate estimates will be provided in the future. In the meantime, consider passing {method : “css”} to fit_kw.

Examples

>>> from statsmodels.tsa.arima_process import arma_generate_sample
>>> import statsmodels.api as sm
>>> import numpy as np
>>> arparams = np.array([.75, -.25])
>>> maparams = np.array([.65, .35])
>>> arparams = np.r_[1, -arparams]
>>> maparam = np.r_[1, maparams]
>>> nobs = 250
>>> np.random.seed(2014)
>>> y = arma_generate_sample(arparams, maparams, nobs)
>>> res = sm.tsa.arma_order_select_ic(y, ic=["aic", "bic"], trend="n")
>>> res.aic_min_order
>>> res.bic_min_order