statsmodels.tsa.arima.model.ARIMA.fit

ARIMA.fit(start_params=None, transformed=True, includes_fixed=False, method=None, method_kwargs=None, gls=None, gls_kwargs=None, cov_type=None, cov_kwds=None, return_params=False, low_memory=False)[source]

Fit (estimate) the parameters of the model.

Parameters:
start_paramsarray_like, optional

Initial guess of the solution for the loglikelihood maximization. If None, the default is given by Model.start_params.

transformedbool, optional

Whether or not start_params is already transformed. Default is True.

includes_fixedbool, optional

If parameters were previously fixed with the fix_params method, this argument describes whether or not start_params also includes the fixed parameters, in addition to the free parameters. Default is False.

methodstr, optional

The method used for estimating the parameters of the model. Valid options include ‘statespace’, ‘innovations_mle’, ‘hannan_rissanen’, ‘burg’, ‘innovations’, and ‘yule_walker’. Not all options are available for every specification (for example ‘yule_walker’ can only be used with AR(p) models).

method_kwargsdict, optional

Arguments to pass to the fit function for the parameter estimator described by the method argument.

glsbool, optional

Whether or not to use generalized least squares (GLS) to estimate regression effects. The default is False if method=’statespace’ and is True otherwise.

gls_kwargsdict, optional

Arguments to pass to the GLS estimation fit method. Only applicable if GLS estimation is used (see gls argument for details).

cov_typestr, optional

The cov_type keyword governs the method for calculating the covariance matrix of parameter estimates. Can be one of:

  • ‘opg’ for the outer product of gradient estimator

  • ‘oim’ for the observed information matrix estimator, calculated using the method of Harvey (1989)

  • ‘approx’ for the observed information matrix estimator, calculated using a numerical approximation of the Hessian matrix.

  • ‘robust’ for an approximate (quasi-maximum likelihood) covariance matrix that may be valid even in the presence of some misspecifications. Intermediate calculations use the ‘oim’ method.

  • ‘robust_approx’ is the same as ‘robust’ except that the intermediate calculations use the ‘approx’ method.

  • ‘none’ for no covariance matrix calculation.

Default is ‘opg’ unless memory conservation is used to avoid computing the loglikelihood values for each observation, in which case the default is ‘oim’.

cov_kwdsdict or None, optional

A dictionary of arguments affecting covariance matrix computation.

opg, oim, approx, robust, robust_approx

  • ‘approx_complex_step’ : bool, optional - If True, numerical approximations are computed using complex-step methods. If False, numerical approximations are computed using finite difference methods. Default is True.

  • ‘approx_centered’ : bool, optional - If True, numerical approximations computed using finite difference methods use a centered approximation. Default is False.

return_paramsbool, optional

Whether or not to return only the array of maximizing parameters. Default is False.

low_memorybool, optional

If set to True, techniques are applied to substantially reduce memory usage. If used, some features of the results object will not be available (including smoothed results and in-sample prediction), although out-of-sample forecasting is possible. Default is False.

Returns:
ARIMAResults

Examples

>>> mod = sm.tsa.arima.ARIMA(endog, order=(1, 0, 0))
>>> res = mod.fit()
>>> print(res.summary())