wntest: Testing for multivariate or high dimensional white noise

Description Usage Arguments Details Value Author(s) References Examples

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

1
2
3
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 χ^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 λ 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 λ and the estimated contempenous correlation (and the precision) matrix with the second smallest cross validation error (default value is 1, the minimun error).

Details

For a p-dimensional weakly stationary time series \varepsilon_t with mean zero, denote by Σ(k)=\textrm{cov}(\varepsilon_{t+k},\varepsilon_t) and Γ(k) = \textrm{diag}\{{Σ}(0)\}^{-1/2} {Σ}(k)\textrm{diag}\{{Σ}(0)\}^{-1/2}, respectively, the autocovariance and the autocorrelation of at lag k. With the available observations \varepsilon_1, …, \varepsilon_n, let

\widehat{Γ}(k) \equiv \{\widehat{ρ}_{ij}(k)\}_{1≤q i,j≤q p} =\textrm{diag}\{\widehat{Σ}(0)\}^{-1/2} \widehat{Σ}(k)\textrm{diag}\{\widehat{Σ}(0)\}^{-1/2}

be the sample autocorrelation matrix at lag k, where \widehat{Σ}(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 ∑_{k=1}^K \textrm{tr}\{\widehat{Γ}(k)^{T} \widehat{Γ}(k)\}, Q_{2} = n^2 ∑_{k=1}^K\textrm{tr}\{\widehat{Γ}(k)^{T} \widehat{Γ}(k)\}/(n-k), and Q_{3} = n ∑_{k=1}^K \textrm{tr}\{\widehat{Γ}(k)^{T}\widehat{Γ}(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 χ^2-approximation and normal approximation are reported.

Since Γ(k) \equiv 0 for any k≥q1 under H_0, the newly proposed maximum cross-correlation-based test uses statistic

T_n=\max_{1≤q k≤q K}T_{n,k},

where T_{n,k}=\max_{1≤q i, j≤q p}{n}^{1/2}|\widehat{ρ}_{ij}(k)| and K≥ 1 is prescribed. Null is rejected whenever T_n>\textrm{cv}_α, where \textrm{cv}_α >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.

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.

Author(s)

Meng Cao, Wen Zhou

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)

## End(Not run)

meca7653/HDtest-2018-8 documentation built on May 16, 2019, 3:13 p.m.