Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

LoglikelihoodAR

Exact Loglikelihood for AR


Description

The exact loglikelihood function, defined in eqn. (6) of McLeod & Zhang (2006) is computed. Requires O(n) flops, n = length(z).

Usage

LoglikelihoodAR(phi, z, MeanValue = 0)

Arguments

phi

AR parameters

z

time series data, not assumed mean corrected

MeanValue

usually this is mean(z) but it could be another value for example the MLE of the mean

Details

Eqn (6) of McLeod and Zhang (2006) may be written

-(n/2) \log(\hatσ_a^2) - (1/2) \log(g_p),

where \hatσ_a^2 is the residual variance and g_p is the covariance determinant.

Value

The value of the loglikelihood is returned

Warning

No check is done for stationary-causal process

Note

For MLE computation it is better to use FastLoglikelihoodAR since for repeated likelihood evaluations this requires only O(1) flops vs O(n) flops, where n = length(z).

Author(s)

A.I. McLeod and Y. Zhang

References

McLeod, A.I. and Zhang, Y. (2006). Partial autocorrelation parameterization for subset autoregression. Journal of Time Series Analysis, 27, 599-612.

See Also

Examples

#Fit a subset model to Series A and verify the loglikelihood
 out<-FitAR(SeriesA, c(1,2,7))
 out
#either using print.default(out) to see the components in out
#or applying LoglikelihoodAR () by first obtaining the phi parameters as out$phiHat.

#
 LoglikelihoodAR(out$phiHat, SeriesA, MeanValue=mean(SeriesA))

FitAR

Subset AR Model Fitting

v1.94
GPL (>= 2)
Authors
A.I. McLeod, Ying Zhang and Changjiang Xu
Initial release
2013-03-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.