LBTest {PRTest}R Documentation

Ljung-Box portmanteau test

Description

This is an object oriented version which can be used to test an time series for randomness or to test the goodness-of-fit of a fitted time series model.

Usage

LBTest(obj, lags = seq(5, 40, 5), SquaredQ = FALSE, BoxPierceQ=FALSE)

Arguments

obj
lags lags to be tested
NREP number of bootstrap replications
SquaredQ use squared residuals
BoxPierceQ if TRUE, the Box-Pierce form of the portmanteau statistic is used

Details

As shown by Ljung and Box (1978) the statistic

Q_m = n (n+2) sum_{k=1}^m frac{r^2_k}{n-k}

where r_k is the autocorrelation at lag k and n is the length of the time series.

Value

the p-values at the corresponding lags

Note

The parametric bootstrap version of this test is implemented in our function PRTest.

Author(s)

A.I. McLeod

References

Box, G.E.P. and Pierce, D.A. (1970). JASA.

Ljung, G.M. and Box, G.E.P. (1979). The Likelihood Function of Stationary Autoregressive-Moving Average Models. Biometrika 66, 265-270.

The use of squared residuals for detecting nonlinearity and ARCH-like effects is discussed in Li (2004).

See Also

LBStat, PRTest, Box.Test

Examples



[Package PRTest version 1.0 Index]