powered by
Box.test.2 computes at different lags, a Portemanteau statistic for testing that a time series is a white noise.
Box.test.2
Box.test.2(x, nlag, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0, decim = 8)
It returns a matrix of size nlag x 2 with the statistics and the p-value
nlag
a time series object
a vector of integers: the lags where the statistic are computed
test to be performed
number of degrees of freedom to be subtracted if x is a series of residuals
an integer, the precision of the results
Yves Aragon
This function uses the Box.test.
Box.test
set.seed(123) y1 <- arima.sim(n = 100, list(ar = -.7), sd = sqrt(4)) a1 <- Box.test.2(y1, nlag = c(3, 6, 9, 12), type = "Ljung-Box", decim = 4)
Run the code above in your browser using DataLab