BackcastResidualsAR: Innovation Residuals in AR

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

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

Usage

1
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 (1970). The idea is to compute the 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 and Y. Zhang

References

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

See Also

InvertibleQ, FitAR

Examples

1
2
3
4
5
6
7
#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)))

FitAR documentation built on May 2, 2019, 3:22 a.m.