lw.statistic: Ledoit-Wolf test statistic

View source: R/lw_statistics.R

lw.statisticR Documentation

Ledoit-Wolf test statistic

Description

This function computes the Ledoit-Wolf test statistic for testing the shape of covariance matrix in the one-sample case

Usage

lw.statistic(x, test = "identity")

Arguments

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 john.nagao.statistic. If test == "identity", the test statistic is equal to the Nagao test statistic and when test == "sphericity", the Ledoit-Wolf test statistic computed is a modified version of the John test statistic.

Value

A list with two values

test.statistic

The test statistic value

p.value

The p-value

References

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.

See Also

john.nagao.statistic

Examples

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")

dnayyala/cramp documentation built on June 27, 2023, 1:34 p.m.