Given a multivariate sample \(X\) and hypothesized covariance matrix \(\Sigma_0\), it tests $$H_0 : \Sigma_x = \Sigma_0\quad vs\quad H_1 : \Sigma_x \neq \Sigma_0$$ using the procedure by Wu and Li (2015). They proposed to use \(m\) number of multiple random projections since only a single operation might attenuate the efficacy of the test.

cov1.2015WL(X, Sigma0 = diag(ncol(X)), m = 25)

Arguments

X

an \((n\times p)\) data matrix where each row is an observation.

Sigma0

a \((p\times p)\) given covariance matrix.

m

the number of random projections to be applied.

Value

a (list) object of S3 class htest containing:

statistic

a test statistic.

p.value

\(p\)-value under \(H_0\).

alternative

alternative hypothesis.

method

name of the test.

data.name

name(s) of provided sample data.

References

Wu T, Li P (2015). “Tests for High-Dimensional Covariance Matrices Using Random Matrix Projection.” arXiv:1511.01611 [stat].

Examples

## CRAN-purpose small example
smallX = matrix(rnorm(10*3),ncol=3)
cov1.2015WL(smallX) # run the test
#> 
#> 	One-sample Test for Covariance Matrix by Wu and Li (2015).
#> 
#> data:  smallX
#> T1m = 0.32076, p-value = 1
#> alternative hypothesis: true covariance is different from Sigma0.
#> 

# \donttest{
## empirical Type 1 error 
##   compare effects of m=5, 10, 50
niter = 1000
rec1  = rep(0,niter) # for m=5
rec2  = rep(0,niter) #     m=10
rec3  = rep(0,niter) #     m=50
for (i in 1:niter){
  X = matrix(rnorm(50*10), ncol=50) # (n,p) = (10,50)
  rec1[i] = ifelse(cov1.2015WL(X, m=5)$p.value < 0.05, 1, 0)
  rec2[i] = ifelse(cov1.2015WL(X, m=10)$p.value < 0.05, 1, 0)
  rec3[i] = ifelse(cov1.2015WL(X, m=50)$p.value < 0.05, 1, 0)
}

## print the result
cat(paste("\n* Example for 'cov1.2015WL'\n","*\n",
"* Type 1 error with m=5   : ",round(sum(rec1/niter),5),"\n",
"* Type 1 error with m=10  : ",round(sum(rec2/niter),5),"\n",
"* Type 1 error with m=50  : ",round(sum(rec3/niter),5),"\n",sep=""))
#> 
#> * Example for 'cov1.2015WL'
#> *
#> * Type 1 error with m=5   : 0.04
#> * Type 1 error with m=10  : 0.042
#> * Type 1 error with m=50  : 0.046
# }