FitARLS(FitAR)R Documentation

Fit subset AR using OLS

Description

The usual subset AR model is defined by selecting a subset of the AR coefficients and setting all other coefficients to zero. Usually this subset model is fit using least squares.

Usage

FitARLS(z, p, SubsetQ = FALSE, lag.max = "default")

Arguments

z time series
p Vector specifying which lags to use in the AR. If SubsetQ=FALSE, p should be a scalar and a regular AR(p) will be fit. For p=0, white noise.
SubsetQ default FALSE. Ignored if p has length > 1. Need set to TRUE for ambiguous cases – see Note.
lag.max The maximum lag to be used in the Portmanteau Test

Details

The design matrix, X, is formed by concatenating together the needed columns and then the R function lsfit is used. An intercept term is used with lsfit. The residuals are computed using BackcastResidualsAR. The exact loglikelihood is computed using LoglikelihoodAR.

Value

A list with class name "FitAR" and components:

loglikelihood value of the loglikelihood using LoglikelihoodAR
phiHat coefficients in AR(p) – including 0's
sigsqHat innovation variance estimate
muHat estimate of the mean
covHat covariance matrix of the coefficient estimates
zetaHat transformed parameters, length(zetaHat)=# coefficients estimated
RacfMatrix residual autocorrelations and sd for lags 1...lag.max
LjungBox table of Ljung-Box portmanteau test statistics
SubsetQ parameters in AR(p) – including 0's
res innovation residuals, same length as z
fits fitted values, same length as z
SubsetQ parameters in AR(p) – including 0's
lags lags used in AR model
demean TRUE if mean estimated otherwise assumed zero
FitMethod "LS" for this function
tsp tsp(z)
call result from match.call() showing how the function was called
yX the dependent variable column prepended to the columns of independent variables
ModelTitle description of model
DataTitle returns attr(z,"title")

Note

If SubsetQ=FALSE, this is equivalent to the built-in function ar( ..., method="OLS"). Note that least-squares residuals are not used. The residuals are calculated using BackcastResidualsAR and the loglikelihood is calculated using LoglikelihoodAR.

Author(s)

A.I. McLeod

References

Tong, H. (1977). Some comments on the Canadian lynx data. Journal of the Royal Statistical Society A 140, 432-436.

See Also

FitAR, LoglikelihoodAR, BackcastResidualsAR, ar

Examples

#Compare the fit achieved by the two types of subset models
z<-log(lynx)
pvec<-SelectModel(z, SubsetModel="z", method="BIC", lag.max=12, Best=1)
pvec
FitARLS(z, pvec)
FitAR(z, pvec)

[Package FitAR version 1.0 Index]