From @unq|ngy@o19970825 @end|ng |rom |c|oud@com  Tue Jun  4 09:36:48 2019
From: @unq|ngy@o19970825 @end|ng |rom |c|oud@com (=?utf-8?B?5a2Z5bqG6ICA?=)
Date: Tue, 4 Jun 2019 15:36:48 +0800
Subject: [Rd] tsdiag should pass the fitdf parameter to Box.test
Message-ID: <ECD8D2D9-9FD4-407C-8377-351FF6511E3C@icloud.com>

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


[Rd] tsdiag should pass the fitdf parameter to Box.test
=?utf-8?B?5a2Z5bqG6ICA?=