View source: R/lw_statistics.R
lw.statistic | R Documentation |
This function computes the Ledoit-Wolf test statistic for testing the shape of covariance matrix in the one-sample case
lw.statistic(x, test = "identity")
x |
data matrix with rows representing samples and columns representing variables |
test |
The type of test being performed - "identity"(default) or "sphericity". The test statistics are modified versions of the |
A list with two values
The test statistic value
The p-value
O. Ledoit and M. Wolf. Some hypothesis tests for the covariance matrix when the dimension is large compared to the sample size. The Annals of Statistics, 30(4):1081–1102, 2002.
john.nagao.statistic
library(mvtnorm)
# Nagao's test for identity
x = rmvnorm(n = 20, mean = numeric(100), sigma = diag(100))
john.nagao.statistic(x, test = "identity")
# John's test for sphericity
y = rmvnorm(n = 10, mean = runif(100, 1, 3), sigma = diag(rgamma(100, 10, 3)))
john.nagao.statistic(y, test = "sphericity")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.