Dear Everyone,

The document of `tsdiag’ says

> These tests are sometimes applied to the residuals from an 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.

This implies that we should pass the `fitdf' parameter when applying `Box.test' 
to residuals. When checking the source code for `getS3method("tsdiag", 
"Arima”)’, however, I noticed that it didn’t pass this parameter. The relevant 
line is `for (i in 1L:nlag) pval[i] <- Box.test(rs, i, type = 
"Ljung-Box")$p.value’. I suppose this could be fixed by passing an additional 
`fitdf = sum(object$arma[1:4])’.

See also this thread on Cross Validated: 
https://stats.stackexchange.com/questions/411432/significance-of-the-parameter-fitdf-in-box-test
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to