Skip to contents

Hosking (1980) generalised the univariate portmanteau statistic to several series at once. His modified form is

Usage

morie_portmanteau_hosking(
  x,
  lags = 10L,
  cdf = NULL,
  fitdf = 0L,
  modified = TRUE
)

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 m in 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 n and large lags where the asymptotic approximation is known to be poor.

fitdf

Parameters already estimated from the series, p + q for a fitted VARMA(p, q). Zero when testing a raw series. The degrees of freedom lose k^2 * fitdf.

modified

Use the (n - lag) weighting of Hosking's equation (9). FALSE gives the unmodified statistic, which weights every lag by n.

Value

Named list with statistic, p_value, df, lags, n, k, fitdf, method.

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.

References

Hosking JRM (1980). The multivariate portmanteau statistic. Journal of the American Statistical Association, 75(371), 602-608.

Mahdi E (2020). portes: an R package for portmanteau tests in time series models. arXiv:2005.00931, equation (9).

Examples

set.seed(1)
morie_portmanteau_hosking(matrix(rnorm(600), 200, 3), lags = 5)$p_value
#> [1] 0.999189