cov1.2012Fisher {SHT}R Documentation

One-sample Test for Covariance Matrix by Fisher (2012)

Description

Given a multivariate sample XX and hypothesized covariance matrix Σ0\Sigma_0, it tests

H0:Σx=Σ0vsH1:ΣxΣ0H_0 : \Sigma_x = \Sigma_0\quad vs\quad H_1 : \Sigma_x \neq \Sigma_0

using the procedure by Fisher (2012). This method utilizes the generalized form of the inequality

1pi=1p(λir1)2s0\frac{1}{p} \sum_{i=1}^p (\lambda_i^r - 1)^{2s} \ge 0

and offers two types of test statistics T1T_1 and T2T_2 corresponding to the case (r,s)=(1,2)(r,s)=(1,2) and (2,1)(2,1) respectively.

Usage

cov1.2012Fisher(X, Sigma0 = diag(ncol(X)), type)

Arguments

X

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

Sigma0

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

type

1 or 2 for corresponding statistic from the paper.

Value

a (list) object of S3 class htest containing:

statistic

a test statistic.

p.value

pp-value under H0H_0.

alternative

alternative hypothesis.

method

name of the test.

data.name

name(s) of provided sample data.

References

Fisher TJ (2012). “On testing for an identity covariance matrix when the dimensionality equals or exceeds the sample size.” Journal of Statistical Planning and Inference, 142(1), 312–326. ISSN 03783758.

Examples

## CRAN-purpose small example
smallX = matrix(rnorm(10*3),ncol=3)
cov1.2012Fisher(smallX) # run the test


## empirical Type 1 error 
niter   = 1000
counter1 = rep(0,niter)  # p-values of the type 1
counter2 = rep(0,niter)  # p-values of the type 2
for (i in 1:niter){
  X = matrix(rnorm(50*5), ncol=50) # (n,p) = (5,50)
  counter1[i] = ifelse(cov1.2012Fisher(X, type=1)$p.value < 0.05, 1, 0)
  counter2[i] = ifelse(cov1.2012Fisher(X, type=2)$p.value < 0.05, 1, 0)
}

## print the result
cat(paste("\n* Example for 'cov1.2012Fisher' \n","*\n",
"* empirical error with statistic 1 : ", round(sum(counter1/niter),5),"\n",
"* empirical error with statistic 2 : ", round(sum(counter2/niter),5),"\n",sep=""))



[Package SHT version 0.1.8 Index]