Box.test(x, lag = 1, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0)lag autocorrelation
coefficients.x
is a series of residuals."htest" containing the following components:
fitdf into account.ARMA(p, q) fit, in which case the references suggest a better
approximation to the null-hypothesis distribution is obtained by
setting fitdf = p+q, provided of course that lag > fitdf.x <- rnorm (100)
Box.test (x, lag = 1)
Box.test (x, lag = 1, type = "Ljung")
Run the code above in your browser using DataLab