Box.test.2 {caschrono} | R Documentation |
Box.test.2
computes at different lags, a 'Portemanteau' statistic
for testing that a time series is a white noise.
Box.test.2(x, nlag, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0, decim = 8)
x |
a time series object |
nlag |
a vector of integers: the lags where the statistic are computed |
type |
test to be performed |
fitdf |
number of degrees of freedom to be subtracted if x is a series of residuals |
decim |
an integer, the precision of the results |
This function uses the Box.test
.
It returns a matrix of size nlag
x 2 with the statistics and the p-value
Yves Aragon
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)