diffloggdp=diff(logGDP)
Box.test(diffloggdp,lag=12,type=c("Ljung-Box"))
m1=ar(diffloggdp,method='mle')
m1
Box.test(m1$residuals,lag=12,type=c("Ljung-Box"))
residuals(m1)
Call:ar(x = diffloggdp, method = "mle")Coefficients: 1 2 3 0.3461 0.1298 -0.1224 Order selected 3 sigma^2 estimated as 8.258e-05> Box.test(m1$residuals,lag=12,type=c("Ljung-Box"))Error in ts(x) : 'ts'对象至少必需有一个或多个观察量求助各位,为什么结果是null