| SNET | R Documentation |
Given two sets of data matrices X and Y, where X is an
n_1 \times p matrix and Y is an n_2 \times p matrix, we
conduct hypothesis testing of the covariance matrix between two samples.
The null hypothesis is
H_0 : \Sigma_1 = \Sigma_2,
where \Sigma_1 and \Sigma_2 are the sample covariance matrices of
X and Y respectively. The test is based on the method proposed
by Cai, Liu and Xia (2013). When the p-value is less than the significance
level (generally 0.05), the null hypothesis is rejected.
SNET(X, Y, B = 200, mc.cores = 1L, alpha = 0.05, k = 3)
X |
A numeric matrix of dimension |
Y |
A numeric matrix of dimension |
B |
Integer, number of bootstrap replicates. Default is 200. |
mc.cores |
Integer, number of cores for parallel computing. Default is 1 (serial execution). |
alpha |
Numeric, significance level. Default is 0.05. |
k |
Numeric, tuning parameter. Default is 3. |
A list with components:
stat |
the test statistic. |
pval |
the p-value. |
z |
the standardized test statistic. |
Cai, T. T., Liu, W., and Xia, Y. (2013). Two-sample covariance matrix testing and support recovery in high-dimensional settings. Journal of the American Statistical Association, 108(501), 265–277.
## Not run:
## generate data from multivariate normal with trivial covariance
p <- 500
n1 <- 100
n2 <- 150
B <- 300
X <- matrix(rnorm(n1 * p), ncol = p)
Y <- matrix(rnorm(n2 * p), ncol = p)
## run test
SNET(X, Y, B, alpha = 0.05)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.