
Hosking's multivariate portmanteau test for white noise
Source:R/whtnse.R
morie_portmanteau_hosking.RdHosking (1980) generalised the univariate portmanteau statistic to several series at once. His modified form is
Arguments
- x
Numeric matrix (n x k) to test, usually residuals from a fitted model. A transposed panel is detected. Columns are demeaned.
- lags
Number of lags
min the sum. Default 10. Must be smaller than the series length.- cdf
Optional function giving the null CDF of the statistic, replacing the asymptotic chi-square. Use it to supply a Monte Carlo null, which is more accurate at the small
nand largelagswhere the asymptotic approximation is known to be poor.- fitdf
Parameters already estimated from the series,
p + qfor a fitted VARMA(p, q). Zero when testing a raw series. The degrees of freedom losek^2 * fitdf.- modified
Use the
(n - lag)weighting of Hosking's equation (9).FALSEgives the unmodified statistic, which weights every lag byn.
Details
$$\tilde Q_m = n^2 \sum_{\ell=1}^{m} (n-\ell)^{-1} \hat r_\ell' (\hat R_0^{-1} \otimes \hat R_0^{-1}) \hat r_\ell$$
with \(\hat r_\ell = vec(\hat R_\ell')\), \(\hat R_\ell = \hat L' \hat\Gamma_\ell \hat L\), \(\hat L \hat L' = \hat\Gamma_0^{-1}\), and \(\hat\Gamma_\ell = n^{-1} \sum_{t=\ell+1}^{n} e_t e_{t-\ell}'\).
The Kronecker form collapses. Because \(\hat L \hat L' = \hat\Gamma_0^{-1}\), the standardised lag-zero matrix \(\hat R_0 = \hat L' \hat\Gamma_0 \hat L\) is the identity, so the quadratic form is \(tr(\hat R_\ell' \hat R_\ell)\). Substituting back gives the trace form computed here,
$$\tilde Q_m = n^2 \sum_{\ell=1}^{m} (n-\ell)^{-1} tr(\hat\Gamma_\ell' \hat\Gamma_0^{-1} \hat\Gamma_\ell \hat\Gamma_0^{-1})$$
which never forms the \(k^2 \times k^2\) Kronecker product.
Under the null the statistic is asymptotically chi-squared on \(k^2(m - fitdf)\) degrees of freedom.
Mirrors morie.fn.whtnse on the Python side; both agree with
portes::Hosking to every printed digit.