Learn R Programming

HDtest (version 2.1)

wntest: Testing for multivariate or high dimensional white noise

Description

A variety of methods to test multivariate or high-dimensional white noise, including classical methods such as the multivariate portmanteau tests, Lagrange multiplier test, as well as the new method proposed by Chang, Yao and Zhou (2017) based on maximum cross correlations.

Usage

wntest(Y, M, k_max = 10, kk, type = 1, alpha = 0.05, k0 = 10,
  delta = 1.5, opt = 1, lambda = 0.01, lambda_search = seq(1e-04,
  0.01, length.out = 50), fold = 5, S1 = NULL, cv_opt = NULL)

Arguments

Y

A \(p\) by \(n\) data matrix with \(p\) time series of length \(n\).

M

Number of bootstrap replicates, ex. \(2000\).

k_max

The largest time lag to be tested for white noise (default is \(10\)).

kk

A vector of time lags using for test (ex. \(kk = \texttt{seq}(2,10, \texttt{by} = 2)\)), scalar is allowed and the largest kk must be less than k_max.

type

Tests to be performed: 1 is coded for the newly proposed maximum cross-correlation-based test for high-dimensional white noise by Chang, Yao and Zhou (2017); 2 is coded for the Lagrange multiplier test; 3 is coded for the three portmanteau tests, where results for both \(\chi^2\) and normal approximations are reported; and 4 is coded for the Tiao-Box likelihoood ratio-based test.

alpha

Level of significance (default is \(0.05\)).

k0

A parameter in time series PCA for pre-transformation (default is \(10\)).

delta

The thresholding parameter in time series PCA for pre-transformation (default is \(1.5\)).

opt

Options for pre-transformation of time series. That is, one considers a transformation matrix \(A_{n\times p}\) and corresponding pre-transformed data \(AY\). For parameter `opt', 1 is coded for performing the transformation using package `fastclime' and user-specific tuning parameter \(\lambda\) for estimating the contempaneous correlations; 2 is coded for performing the transformation using the sample covariance; 3 is coded for performing the transformation using package `clime' with build-in cross validation on the tuning parameter for estimating the contempaneous correlations; 4 is coded for performing the transformation using `fastclime' with cross validation on the tuning parameter for estimating the contempaneous correlations; and else do not perform the transformation.

lambda

The tuning parameter used in package `fastclime', which is required for `opt=1'. The default value is \(0.1\).

lambda_search

The tuning parameters search for package `fastclime', which is required for `opt=4' (default is \(\texttt{seq}(1e-4, 1e-2, \texttt{length.out} = 50)\)).

fold

Number of folds used in cross validations (default is \(5\)).

S1

True contempaneous \(p\times p\) covariance matrix of the data if it is known in advance. If provided, pre-transformation will use S1 instead of options in `opt'.

cv_opt

Specify which tuning parameter and the corresponding estimated contempenous correlation (and the precision) matrix to be used for the pre-transformation. For example, `cv_opt = 2' will choose \(\lambda\) and the estimated contempenous correlation (and the precision) matrix with the second smallest cross validation error (default value is \(1\), the minimun error).

Value

res

Test output: fail to reject (coded as \(0\)) or reject (coded as \(1\)).

p_value

\(p\)-values or approximated \(p\)-value.

M1

Square root of the estimated contempenous precision matrix if pre-transfermation was applied.

Details

For a \(p\)-dimensional weakly stationary time series \(\varepsilon_t\) with mean zero, denote by \(\Sigma(k)=\textrm{cov}(\varepsilon_{t+k},\varepsilon_t)\) and \(\Gamma(k) = \textrm{diag}\{{\Sigma}(0)\}^{-1/2} {\Sigma}(k)\textrm{diag}\{{\Sigma}(0)\}^{-1/2}\), respectively, the autocovariance and the autocorrelation of at lag \(k\). With the available observations \(\varepsilon_1, \ldots, \varepsilon_n\), let $$ \widehat{\Gamma}(k) \equiv \{\widehat{\rho}_{ij}(k)\}_{1\leq i,j\leq p} =\textrm{diag}\{\widehat{\Sigma}(0)\}^{-1/2} \widehat{\Sigma}(k)\textrm{diag}\{\widehat{\Sigma}(0)\}^{-1/2} $$ be the sample autocorrelation matrix at lag \(k\), where \(\widehat{\Sigma}(k)\) is the sample autocovariance matrix. Consider the hypothesis testing problem $$ H_0:\{\varepsilon_t\}~\mbox{is white noise}~~~\textrm{versus} ~~~H_1:\{\varepsilon_t\}~\mbox{is not white noise}. $$

To test the above hypothesis of multivariate or high dimensional white noise, we include the traditional portmanteau tests with test statistics: \(Q_{1} = n \sum_{k=1}^K \textrm{tr}\{\widehat{\Gamma}(k)^{T} \widehat{\Gamma}(k)\}\), \(Q_{2} = n^2 \sum_{k=1}^K\textrm{tr}\{\widehat{\Gamma}(k)^{T} \widehat{\Gamma}(k)\}/(n-k)\), and \(Q_{3} = n \sum_{k=1}^K \textrm{tr}\{\widehat{\Gamma}(k)^{T}\widehat{\Gamma}(k)\} + p^2K(K+1)/(2n)\). Also, we include the Lagranage multiplier test as well as the Tiao-Box likelihood ratio test. For the portmanteau tests, both \(\chi^2\)-approximation and normal approximation are reported.

Since \(\Gamma(k) \equiv 0\) for any \(k\geq1\) under \(H_0\), the newly proposed maximum cross-correlation-based test uses statistic $$ T_n=\max_{1\leq k\leq K}T_{n,k}, $$ where \(T_{n,k}=\max_{1\leq i, j\leq p}{n}^{1/2}|\widehat{\rho}_{ij}(k)|\) and \(K\ge 1\) is prescribed. Null is rejected whenever \(T_n>\textrm{cv}_\alpha\), where \(\textrm{cv}_\alpha >0\) is the critical value determined by novel bootstrap method proposed by Chang, Yao and Zhou (2017) with no further assumptions on the data structures.

References

Chang, J., Yao, Q. and Zhou, W., 2017. Testing for high-dimensional white noise using maximum cross-correlations. Biometrika, 104(1): 111-127.

Cai, T.T., Liu, W., and Luo, X., 2011. A constrained L1 minimization approach for sparse precision matrix estimation. Journal of the American Statistical Association 106(494): 594-607.

Lutkepohl, H., 2005. New introduction to multiple time series analysis. Springer Science & Business Media.

Examples

Run this code
# NOT RUN {
library(expm)
p = 15
n = 300
S1 = diag(1, p, p)
for(ii in c(1:p)){
for(jj in c(1:p)){
S1[ii, jj] = 0.995^(abs(ii-jj))
}
}
S11 = sqrtm(S1)
X = S11 %*% matrix(rt(n*p, df = 8), ncol = n)
k_max = 10
kk = seq(2, k_max, 2)
M = 500
k0 = 10
delta = 1.5
alpha = 0.05
wntest(X, M, k_max, kk, type = 1, opt = 0)
# }
# NOT RUN {
wntest(X, M, k_max, kk, type = 1, opt = 4, cv_opt = 1)
# }

Run the code above in your browser using DataLab