SpecMulTest: Multiple testing with FDR control for spectral density matrix

View source: R/Tools_SpecTest.R

SpecMulTestR Documentation

Multiple testing with FDR control for spectral density matrix

Description

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.

Usage

SpecMulTest(Q, PVal, alpha = 0.05, seq_len = 0.01)

Arguments

Q

The number of the hypothesis tests.

PVal

A vector of length Q representing p-values of the Q hypothesis tests.

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 \sqrt{2\times\log Q-2\times\log(\log Q )}. The default is 0.01.

Value

An object of class "hdtstest", which contains the following component:

MultiTest

A logical vector of length Q. If its q-th element is TRUE, it indicates that H_{0,q} should be rejected. Otherwise, H_{0,q} should not be rejected.

References

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")}.

See Also

SpecTest

Examples

# 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


HDTSA documentation built on April 3, 2025, 11:07 p.m.