I get an inconsistent result for the Ljung-Box test: in fact when I run it using the Box.test function it doesn't make me reject the null hypothesis of residuals being white noise, but when I plot the result they're clearly not white noise. The lag used is 72 because I was told to use a quarter of the total number of observations. I'm doing it with AR(6) because from the PACF there's a clear cutoff after lag 6.

> pacf(ts(gdplogdiff),main="PACF of GDP time series")
> acf(ts(gdplogdiff),main="ACF of GDP time series")
> plot(diff(loggpdtimeseries),ylab="Differentiated log")
> ar6=arima(gdplogdiff,order=c(6,0,0))
> Box.test(ar6$residuals,lag=72,type="Ljung-Box",fitdf = 6)
    Box-Ljung test

data:  ar6$residuals
X-squared = 75.512, df = 66, p-value = 0.1981

And this is the plot of the following codeenter image description here


1 Answer 1


I would suggest reducing the 72 to say 24 or 12 as the Ljung-Box test has not passed the test of time ( that's a joke ! ) as it's assymptotic properties have been called into serious question. See Testing for autocorrelation: Ljung-Box versus Breusch-Godfrey and elsehwere .....

Time to tell your instructor and the authors of your textbook the news !


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.