Description Usage Arguments Details Value Author(s) References Examples
A variety of methods to test multivariate or highdimensional 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.
1 2 3 
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 crosscorrelationbased test for highdimensional 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 TiaoBox likelihoood ratiobased test. 
alpha 
Level of significance (default is 0.05). 
k0 
A parameter in time series PCA for pretransformation (default is 10). 
delta 
The thresholding parameter in time series PCA for pretransformation (default is 1.5). 
opt 
Options for pretransformation of time series. That is, one considers a transformation matrix A_{n\times p} and corresponding pretransformed data AY. For parameter ‘opt’, 1 is coded for performing the transformation using package ‘fastclime’ and userspecific 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 buildin 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}(1e4, 1e2, \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, pretransformation 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 pretransformation. 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). 
For a pdimensional 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)\}/(nk), 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 TiaoBox likelihood ratio test. For the portmanteau tests, both χ^2approximation and normal approximation are reported.
Since Γ(k) \equiv 0 for any k≥q1 under H_0, the newly proposed maximum crosscorrelationbased 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.
res 
Test output: fail to reject (coded as 0) or reject (coded as 1). 
p_value 
pvalues or approximated pvalue. 
M1 
Square root of the estimated contempenous precision matrix if pretransfermation was applied. 
Meng Cao, Wen Zhou
Chang, J., Yao, Q. and Zhou, W., 2017. Testing for highdimensional white noise using maximum crosscorrelations. Biometrika, 104(1): 111127.
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): 594607.
Lutkepohl, H., 2005. New introduction to multiple time series analysis. Springer Science & Business Media.
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(iijj))
}
}
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)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.