LoglikelihoodAR(FitAR)R Documentation

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 is to FastLoglikelihood since for repeated likelihood evaluations this requires only O(1) flops vs O(n) flops, where n=length(z).

Author(s)

A.I. McLeod

References

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

See Also

FastLoglikelihood

Examples

#Fit a subset model to Series A and verify the loglikelihood
 data(SeriesA)
 out<-FitAR(SeriesA, c(1,2,7))
 out
#either using print.default(out) to see the components in out
# or from the documentation, we can obtain the phi parameters as,
#out$phiHat
#
 LoglikelihoodAR(out$phiHat, SeriesA, MeanValue=mean(SeriesA))


[Package FitAR version 1.0 Index]