tsdiag should pass the fitdf parameter to Box.test
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])’.