BackcastResidualsAR {FitAR}R Documentation

Innovation Residuals in AR

Description

Obtains the residuals (estimated innovations). The residuals for t=1,...,p are obtained using the backforecasting algorithm of Box and Jenkins (1970).

Usage

BackcastResidualsAR(y, phi, Q = 100, demean=TRUE)

Arguments

y a time series or vector
phi AR coefficients, lags 1,...,p
Q for backcasting, the AR is approximated by an MA(Q)
demean subtract sample mean

Details

The backforecasting algorithm is described in detail in the book of Box and Jenkins. The idea is to expected value of the innovation assuming a high-order MA(q).

Value

Vector of residuals

Note

No check is done that the AR is causal-stationary.

Author(s)

A.I. McLeod

References

Box and Jenkins (1970). Time Series Analysis: Forecasting and Control.

See Also

InvertibleQ, FitAR

Examples

#compare residuals obtained using backcasting with fitted parameters and
# the residuals extracted from output of FitAR.  They are identical.
p<-11
out<-FitAR(log(lynx), p)
phi<-out$phiHat #fitted parameters
resphi<-BackcastResidualsAR(log(lynx), phi)
sum(abs(resphi-resid(out)))

[Package FitAR version 1.0 Index]