Logo

statsmodels.tsa.ar_model.AR.fit

AR.fit(maxlag=None, method='cmle', ic=None, trend='c', transparams=True, start_params=None, solver=None, maxiter=35, full_output=1, disp=1, callback=None, **kwargs)[source]

Fit the unconditional maximum likelihood of an AR(p) process.

Parameters:

start_params : array-like, optional

Initial guess of the solution for the loglikelihood maximization. The default is an array of zeros.

method : str {‘newton’,’nm’,’bfgs’,’powell’,’cg’, or ‘ncg’}

Method can be ‘newton’ for Newton-Raphson, ‘nm’ for Nelder-Mead, ‘bfgs’ for Broyden-Fletcher-Goldfarb-Shanno, ‘powell’ for modified Powell’s method, ‘cg’ for conjugate gradient, or ‘ncg’ for Newton- conjugate gradient. method determines which solver from scipy.optimize is used. The explicit arguments in fit are passed to the solver. Each solver has several optional arguments that are not the same across solvers. See the notes section below (or scipy.optimize) for the available arguments.

maxiter : int

The maximum number of iterations to perform.

full_output : bool

Set to True to have all available output in the Results object’s mle_retvals attribute. The output is dependent on the solver. See LikelihoodModelResults notes section for more information.

disp : bool

Set to True to print convergence messages.

fargs : tuple

Extra arguments passed to the likelihood function, i.e., loglike(x,*args)

callback : callable callback(xk)

Called after each iteration, as callback(xk), where xk is the current parameter vector.

retall : bool

Set to True to return list of solutions at each iteration. Available in Results object’s mle_retvals attribute.

See also

statsmodels.model.LikelihoodModel.fit, on

Notes

Optional arguments for the solvers (available in Results.mle_settings):

‘newton’
tol : float
Relative error in params acceptable for convergence.
‘nm’ – Nelder Mead
xtol : float
Relative error in params acceptable for convergence
ftol : float
Relative error in loglike(params) acceptable for convergence
maxfun : int
Maximum number of function evaluations to make.
‘bfgs’
gtol : float
Stop when norm of gradient is less than gtol.
norm : float
Order of norm (np.Inf is max, -np.Inf is min)
epsilon
If fprime is approximated, use this value for the step size. Only relevant if LikelihoodModel.score is None.
‘cg’
gtol : float
Stop when norm of gradient is less than gtol.
norm : float
Order of norm (np.Inf is max, -np.Inf is min)
epsilon : float
If fprime is approximated, use this value for the step size. Can be scalar or vector. Only relevant if Likelihoodmodel.score is None.
‘ncg’
fhess_p : callable f’(x,*args)
Function which computes the Hessian of f times an arbitrary vector, p. Should only be supplied if LikelihoodModel.hessian is None.
avextol : float
Stop when the average relative error in the minimizer falls below this amount.
epsilon : float or ndarray
If fhess is approximated, use this value for the step size. Only relevant if Likelihoodmodel.hessian is None.
‘powell’
xtol : float
Line-search error tolerance
ftol : float
Relative error in loglike(params) for acceptable for convergence.
maxfun : int
Maximum number of function evaluations to make.
start_direc : ndarray
Initial direction set.

References

Jones, R.H. 1980 “Maximum likelihood fitting of ARMA models to time
series with missing observations.” Technometrics. 22.3. 389-95.

Previous topic

statsmodels.tsa.ar_model.AR

Next topic

statsmodels.tsa.ar_model.AR.hessian

This Page