statsmodels.tsa.ar_model.AR.loglike

AR.loglike(params)[source]

The loglikelihood of an AR(p) process.

Parameters
paramsndarray

The fitted parameters of the AR model.

Returns
float

The loglikelihood evaluated at params.

Notes

Contains constant term. If the model is fit by OLS then this returns the conditional maximum likelihood.

(np)2(log(2π)+log(σ2))1σ2iϵ2i

If it is fit by MLE then the (exact) unconditional maximum likelihood is returned.

n2log(2π)n2log(σ2)+12|V1p|12σ2(ypμp)V1p(ypμp)12σ2nt=p+1ϵ2i

where

μp is a (p x 1) vector with each element equal to the mean of the AR process and σ2Vp is the (p x p) variance-covariance matrix of the first p observations.