View source: R/Tools_SpecTest.R
SpecMulTest | R Documentation |
SpecMulTest()
implements a new multiple testing procedure proposed in
Chang et al. (2022) for the following Q
hypothesis testing problems:
H_{0,q}:f_{i,j}(\omega)=0\mathrm{\ for\ any\ }(i,j)\in\mathcal{I}^{(q)}\mathrm{\ and\ }
\omega\in\mathcal{J}^{(q)}\mathrm{\ \ versus\ \ }
H_{1,q}:H_{0,q}\mathrm{\ is\ not\ true}
for q=1,\dots,Q
.
Here, 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
,
and \mathcal{I}^{(q)}
and \mathcal{J}^{(q)}
refer to
the set of index pairs and the set of frequencies associated with the
q
-th test, respectively.
SpecMulTest(Q, PVal, alpha = 0.05, seq_len = 0.01)
Q |
The number of the hypothesis tests. |
PVal |
A vector of length |
alpha |
The prescribed level for the FDR control. The default is 0.05. |
seq_len |
The step size for generating a sequence from 0 to
|
An object of class "hdtstest"
, which contains the following
component:
MultiTest |
A logical vector of length |
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")}.
SpecTest
# 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)
Q <- 4
## Generate the sets Iq and Jq
ISET <- list()
ISET[[1]] <- matrix(c(1,2),ncol=2)
ISET[[2]] <- matrix(c(1,3),ncol=2)
ISET[[3]] <- matrix(c(1,4),ncol=2)
ISET[[4]] <- matrix(c(1,5),ncol=2)
JSET <- as.list(2*pi*seq(0,3)/4 - pi)
## Calculate Q p-values
PVal <- rep(NA,Q)
for (q in 1:Q) {
cross.indices <- ISET[[q]]
J.set <- JSET[[q]]
temp.q <- SpecTest(t(x), J.set, cross.indices, B, flag_c)
PVal[q] <- temp.q$p.value
}
res <- SpecMulTest(Q, PVal)
res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.