tsdiag should pass the fitdf parameter to Box.test

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

tsdiag should pass the fitdf parameter to Box.test

R devel mailing list
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
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel