View source: R/Tools_SpecTest.R
SpecTest | R Documentation |
SpecTest()
implements a new global test proposed in
Chang et al. (2022) for the following hypothesis testing problem:
H_0:f_{i,j}(\omega)=0 \mathrm{\ for\ any\ }(i,j)\in \mathcal{I}\mathrm{\ and\ }
\omega \in \mathcal{J}\mathrm{\ \ versus\ \ }H_1:H_0\mathrm{\ is\ not\ true }\,,
where f_{i,j}(\omega)
represents the cross-spectral density between
x_{t,i}
and x_{t,j}
at frequency \omega
with x_{t,i}
being
the i
-th component of the p \times 1
times series {\bf x}_t
.
Here, \mathcal{I}
is the set of index pairs of interest, and
\mathcal{J}
is the set of frequencies.
SpecTest(X, J.set, cross.indices, B = 1000, flag_c = 0.8)
X |
An |
J.set |
A vector representing the set |
cross.indices |
An |
B |
The number of bootstrap replications for generating multivariate normally distributed random vectors when calculating the critical value. The default is 2000. |
flag_c |
The bandwidth |
An object of class "hdtstest"
, which contains the following
components:
Stat |
The test statistic of the test. |
pval |
The p-value of the test. |
cri95 |
The critical value of the test at the significance level 0.05. |
Chang, J., Jiang, Q., McElroy, T. S., & Shao, X. (2022). Statistical inference for high-dimensional spectral density matrix. arXiv preprint. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.48550/arXiv.2212.13686")}.
SpecMulTest
# Example 1
## Generate xt
n <- 200
p <- 10
flag_c <- 0.8
B <- 1000
burn <- 1000
z.sim <- matrix(rnorm((n+burn)*p),p,n+burn)
phi.mat <- 0.4*diag(p)
x.sim <- phi.mat %*% z.sim[,(burn+1):(burn+n)]
x <- x.sim - rowMeans(x.sim)
## Generate the sets I and J
cross.indices <- matrix(c(1,2), ncol=2)
J.set <- 2*pi*seq(0,3)/4 - pi
res <- SpecTest(t(x), J.set, cross.indices, B, flag_c)
Stat <- res$statistic
Pvalue <- res$p.value
CriVal <- res$cri95
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.