CLX: Two-Sample Covariance Test by Cai, Liu and Xia (2013)

View source: R/CLX.R

CLXR Documentation

Two-Sample Covariance Test by Cai, Liu and Xia (2013)

Description

Given two sets of data matrices X and Y, where X is an n1 rows and p cols matrix and Y is an n2 rows and p cols matrix, we conduct hypothesis testing of the covariance matrix between two samples. The null hypothesis is:

H_0 : \Sigma_1 = \Sigma_2

\Sigma_1 and \Sigma_2 are the sample covariance matrices of X and Y respectively. This test method is based on the test method proposed by Cai, Liu and Xia (2013). When the pval value is less than the significance coefficient (generally 0.05), the null hypothesis is rejected.

Usage

CLX(X,Y)

Arguments

X

A matrix of n1 by p

Y

A matrix of n2 by p

Value

stat

a test statistic value.

pval

a test p_value.

References

Cai, T. T., Liu, W., and Xia, Y. (2013). Two-sample covariance matrix testing and support recovery in high-dimensional and sparse settings. Journal of the American Statistical Association, 108(501):265-277.

Examples

## generate X and Y.
p= 500;  n1 = 100; n2 = 150
X=matrix(rnorm(n1*p), ncol=p)
Y=matrix(rnorm(n2*p), ncol=p)
## run test
CLX(X,Y)

Docovt documentation built on June 30, 2025, 9:07 a.m.

Related to CLX in Docovt...