Log-likelihood ratio test for equality of one covariance matrix {mvhtests}R Documentation

Log-likelihood ratio test for equality of one covariance matrix

Description

Log-likelihood ratio test for equality of one covariance matrix.

Usage

equal.cov(x, Sigma, a = 0.05)

Arguments

x

A matrix containing Euclidean data.

Sigma

The hypothesis covariance matrix.

a

The significance level, set to 0.05 by default.

Details

The hypothesis test is that the the sample covariance is equal to some specified covariance matrix: H0:Σ=Σ0H_0:\pmb{\Sigma}=\pmb{\Sigma}_0, with μ\pmb{\mu} unknown. The algorithm for this test is taken from Mardia, Bibby and Kent (1979, pg. 126-127). The test is based upon the log-likelihood ratio test. The form of the test is

2logλ=ntr{Σ01S}nlogΣ01Snp, -2\log{\lambda}=n \text{tr}\left\lbrace \pmb{\Sigma}_0^{-1}{\bf S}\right\rbrace-n\log{\left|\pmb{\Sigma}_0^{-1}{\bf S} \right|}-np,

where nn is the sample size, Σ0\pmb{\Sigma}_0 is the specified covariance matrix under the null hypothesis, S{\bf S} is the sample covariance matrix and pp is the dimensionality of the data (or the number of variables). Let α\alpha and gg denote the arithmetic mean and the geometric mean respectively of the eigenvalues of Σ01S\pmb{\Sigma}_0^{-1}{\bf S}, so that tr{Σ01S}=pαtr\left\lbrace \pmb{\Sigma}_0^{-1}{\bf S}\right\rbrace=p\alpha and Σ01S=gp\left|\pmb{\Sigma}_0^{-1}{\bf S} \right|=g^p, then the test statistic becomes

2logλ=np(αlog(g)1). -2\log{\lambda}=np\left(\alpha-log{(g)}-1 \right).

The degrees of freedom of the χ2\chi^2 distribution are 12p(p+1)\frac{1}{2}p\left(p+1\right).

Value

A vector with the the test statistic, the p-value, the degrees of freedom and the critical value of the test.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Mardia K.V., Kent J.T. and Bibby J.M. (1979). Multivariate Analysis. London: Academic Press.

See Also

likel.cov, Mtest.cov

Examples

x <- as.matrix( iris[, 1:4] )
s <- cov(x) * 1.5
equal.cov(x, s)

[Package mvhtests version 1.0 Index]