Learn R Programming

CovTools (version 0.5.0)

CovTest1: One-Sample Tests for Covariance Matrices

Description

Given data, CovTest1 performs 1-sample test for Covariance where the null hypothesis is $$H_0 : \Sigma_n = \Sigma_0$$ where \(\Sigma_n\) is the covariance of data model and \(\Sigma_0\) is a hypothesized covariance.

Usage

CovTest1(data, Sigma0 = diag(ncol(data)), alpha = 0.05,
  method = c("Cai13", "Srivastava14"))

Arguments

data

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

Sigma0

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

alpha

level of significance.

method

a name of test.

Value

a named list containing

statistic

a test statistic value.

threshold

rejection criterion to be compared against test statistic.

reject

a logical; TRUE to reject null hypothesis, FALSE otherwise.

References

cai_optimal_2013CovTools

srivastava_tests_2014CovTools

Examples

Run this code
# NOT RUN {
## generate data from multivariate normal with trivial covariance.
data = matrix(rnorm(100*5), nrow=100)

## run test
CovTest1(data, method="Cai13")
CovTest1(data, method="Srivastava14")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab