Tutorials › Multivariate Statistics (Graduate) › Sphericity Tests for Covariance Structure

PCA Inference and Asymptotics · Tutorial 519 of 975

Sphericity Tests for Covariance Structure

Learn how to test whether covariance eigenvalues are equal, distinguish that hypothesis from identity covariance, and calibrate the corresponding Gaussian likelihood-ratio statistics.

Advanced 12 min read

What You'll Learn

  • Define covariance sphericity as equality of all population covariance eigenvalues.
  • Derive the Gaussian likelihood-ratio statistic for a spherical covariance matrix with unknown scale.
  • Obtain its chi-square degrees of freedom from the dimensions of the null and alternative models.
  • Distinguish a spherical covariance test from a test that covariance is the identity matrix.
  • Relate covariance sphericity to Mauchly’s test and correlation identity to Bartlett’s test.
  • Identify the assumptions and common interpretations that can invalidate a sphericity test.

What “Sphericity” Tests

In principal component analysis, covariance eigenvalues describe how much variation lies along different directions. A covariance matrix is spherical when no direction has a different variance from any other: its eigenvalues are all equal. Testing this condition is therefore a direct way to assess whether the covariance structure has a preferred direction.

Sphericity is not the same hypothesis as a known identity covariance. Under sphericity, the common variance is an unknown positive parameter; under identity covariance, every variance is fixed at one. A related test asks whether the population correlation matrix is identity, which means the variables are uncorrelated but does not require their variances to be equal.

Definition: A positive-definite covariance matrix \(\Sigma\) is spherical if \(\Sigma=\sigma^2 I_p\) for some \(\sigma^2>0\), where \(I_p\) is the \(p\)-dimensional identity matrix. Equivalently, all \(p\) eigenvalues of \(\Sigma\) are equal. The covariance identity hypothesis is the more restrictive, fully specified condition \(\Sigma=I_p\).

For the Gaussian tests below, suppose \(X_1,\ldots,X_n\) are independent and identically distributed as \(N_p(\mu,\Sigma)\), with unknown mean \(\mu\), fixed dimension \(p\), and \(n>p\). Define the maximum-likelihood covariance estimate after estimating the mean by

$$ A=\frac{1}{n}\sum_{i=1}^n(X_i-\bar X)(X_i-\bar X)^\top,\qquad \bar X=\frac{1}{n}\sum_{i=1}^nX_i. $$

With probability one, \(A\) is positive definite under these conditions, so its determinant and log-determinant are defined. The usual unbiased sample covariance is \(S=\frac{1}{n-1}\sum_i(X_i-\bar X)(X_i-\bar X)^\top\); it is a positive scalar multiple of \(A\), and therefore gives the same scale-free sphericity statistic.

Likelihood Ratio for Spherical Covariance

Consider the hypotheses \(H_0:\Sigma=\sigma^2 I_p\) for some \(\sigma^2>0\), against \(H_1:\Sigma\) is any positive-definite covariance matrix. The Gaussian log-likelihood, apart from a constant, is

$$ \ell(\mu,\Sigma)=-\frac{n}{2}\log|\Sigma| -\frac{1}{2}\sum_{i=1}^n(X_i-\mu)^\top\Sigma^{-1}(X_i-\mu). $$

For any fixed \(\Sigma\), maximizing over \(\mu\) gives \(\hat\mu=\bar X\). In the unrestricted model the covariance maximum-likelihood estimate is \(A\). Under the spherical null, substituting \(\Sigma=\sigma^2I_p\) into the likelihood shows that the maximizing scale is \(\hat\sigma^2=\operatorname{tr}(A)/p\). These estimates give the likelihood ratio and its log form.

Theorem: For the Gaussian spherical-covariance likelihood-ratio test, the statistic is \[ Q_{\mathrm{sph}}=-2\log\Lambda =n\left\{p\log\left(\frac{\operatorname{tr}(A)}{p}\right)-\log|A|\right\}. \] Under \(H_0\), with fixed \(p\) and \(n\to\infty\), \(Q_{\mathrm{sph}}\xrightarrow{d}\chi^2_{p(p+1)/2-1}\).

To derive the statistic, at the unrestricted maximum the quadratic term in the log-likelihood is \(np\), since \(\sum_i(X_i-\bar X)^\top A^{-1}(X_i-\bar X)=np\). At the spherical maximum it is also \(np\): the quadratic term is \(\operatorname{tr}(nA)/\hat\sigma^2=np\). Thus those terms cancel in twice the difference of maximized log-likelihoods. The determinant term gives

$$ -2\log\Lambda =n\log\left(\frac{|\hat\sigma^2 I_p|}{|A|}\right) =n\left\{p\log\left(\frac{\operatorname{tr}(A)}{p}\right)-\log|A|\right\}. $$

This statistic is unchanged if \(A\) is multiplied by any positive scalar: the determinant is multiplied by that scalar to the power \(p\), and the trace term changes by the same amount on the log scale. It therefore tests equality of eigenvalues, not the value of the common variance. In terms of the eigenvalues \(\hat\lambda_1,\ldots,\hat\lambda_p\) of \(A\),

$$ Q_{\mathrm{sph}} =n\log\left\{\frac{\left(\frac{1}{p}\sum_{j=1}^p\hat\lambda_j\right)^p} {\prod_{j=1}^p\hat\lambda_j}\right\}. $$

The arithmetic-geometric mean inequality implies \(Q_{\mathrm{sph}}\geq 0\), with equality exactly when all sample eigenvalues are equal. The statistic is thus large when the observed eigenvalues are unequal relative to their common average.

For the asymptotic calibration, the unrestricted covariance model has \(p(p+1)/2\) free parameters, one for each entry on or above the diagonal of a symmetric matrix. The spherical null has one free covariance parameter, \(\sigma^2\). Their dimension difference is \(p(p+1)/2-1\). The null is an interior, smooth, identifiable submodel of the positive-definite covariance model, and the Gaussian likelihood is regular. Wilks’ theorem therefore gives the stated chi-square limit. This is a large-sample approximation, not an exact finite-sample distribution.

Worked Example: Testing Equal Covariance Eigenvalues

Suppose \(p=3\), \(n=60\), and the eigenvalues of \(A\) are \(4,1,1\). Calculate the sphericity statistic and its asymptotic reference degrees of freedom.

The average eigenvalue is \((4+1+1)/3=2\), and their product is \(4\). Hence

$$ W=\frac{|A|}{\{\operatorname{tr}(A)/3\}^3} =\frac{4}{2^3}=\frac12,\qquad Q_{\mathrm{sph}}=-60\log(W)=60\log(2)\approx41.59. $$

The chi-square degrees of freedom are \(3(4)/2-1=5\). The statistic is large relative to a \(\chi^2_5\) distribution, so the data provide strong evidence against equal covariance eigenvalues. This conclusion concerns equality of eigenvalues; it does not test whether their common value is one.

Identity Covariance Is a Different Test

To test \(H_0:\Sigma=I_p\) against an unrestricted covariance matrix, the null has no free covariance parameters, while the alternative has \(p(p+1)/2\). Maximizing under the null and alternative gives the Gaussian likelihood-ratio statistic

Result: With unknown mean and \(A\) as defined above, the likelihood-ratio statistic for \(H_0:\Sigma=I_p\) is \[ Q_I=n\{\operatorname{tr}(A)-\log|A|-p\}. \] Under the identity null, fixed \(p\), and \(n\to\infty\), \(Q_I\xrightarrow{d}\chi^2_{p(p+1)/2}\).

Indeed, under the identity null the log-likelihood at \(\hat\mu=\bar X\) contains the quadratic term \(n\operatorname{tr}(A)\). At the unrestricted maximum, the quadratic term is \(np\), and the covariance determinant contributes \(\log|A|\). Subtracting the maximized log-likelihoods yields \(Q_I\). Wilks’ theorem applies with dimension difference \(p(p+1)/2-0\). Unlike \(Q_{\mathrm{sph}}\), this statistic responds to the overall scale as well as to unequal eigenvalues.

Worked Example: Spherical Does Not Mean Identity

Let \(p=2\), \(n=40\), and suppose \(A=2I_2\). The two eigenvalues are both 2, so the sample covariance is spherical. For the sphericity statistic,

$$ Q_{\mathrm{sph}} =40\left\{2\log\left(\frac{\operatorname{tr}(A)}{2}\right)-\log|A|\right\} =40\{2\log(2)-\log(4)\}=0. $$

The identity-covariance statistic is different. Here \(\operatorname{tr}(A)=4\) and \(|A|=4\), so

$$ Q_I=40\{4-\log(4)-2\} =40\{2-\log(4)\} \approx40(0.613706)=24.55. $$

Thus the observed matrix fits the equal-eigenvalue condition exactly but is not close to identity: its common variance is 2, not 1. The two tests answer distinct questions and can give very different conclusions.

Mauchly’s and Bartlett’s Sphericity Tests

The scale-free determinant ratio

$$ W=\frac{|A|}{\{\operatorname{tr}(A)/p\}^p} $$

is known as Mauchly’s sphericity criterion. It lies between zero and one, equals one when the covariance eigenvalues are equal, and becomes small as they become more dispersed. The likelihood-ratio statistic is \(-n\log W\), with the chi-square calibration derived above. Mauchly’s classical finite-sample approximation uses a Bartlett correction to the multiplier; it is an approximation, not an exact distribution. For the conventional centered-sample form, the adjusted statistic is \(-[n-1-(2p+5)/6]\log W\), referenced to \(\chi^2_{p(p+1)/2-1}\). The unadjusted Wilks statistic is the direct likelihood-ratio form and has the same first-order large-sample limit.

A different classical procedure, Bartlett’s test of sphericity, tests whether the population correlation matrix is identity. This is the null of zero pairwise correlations, not the covariance-sphericity null. Let \(R\) be the sample correlation matrix. Under Gaussian sampling, the likelihood ratio comparing unrestricted covariance with a diagonal covariance matrix has statistic \(-n\log|R|\); its degrees of freedom are the number of off-diagonal covariance parameters, \(p(p-1)/2\). The conventional Bartlett-corrected approximation is

$$ -\left[n-1-\frac{2p+5}{6}\right]\log|R| \ \approx\ \chi^2_{p(p-1)/2}. $$

This correlation test allows different variances: a diagonal covariance matrix can have unequal diagonal entries. Consequently, rejection of the correlation-identity null does not by itself establish unequal covariance eigenvalues, and failure to reject it does not establish covariance sphericity.

Worked Example: Bartlett’s Test of Correlation Identity

Suppose \(p=3\), \(n=80\), and the sample correlation matrix has all off-diagonal entries equal to \(0.2\):

$$ R=\begin{pmatrix} 1&0.2&0.2\\ 0.2&1&0.2\\ 0.2&0.2&1 \end{pmatrix}. $$

For a three-variable equicorrelation matrix, the determinant is \((1-r)^2(1+2r)\). With \(r=0.2\), this gives \(|R|=(0.8)^2(1.4)=0.896\). The Bartlett-corrected statistic is therefore

$$ -\left[80-1-\frac{2(3)+5}{6}\right]\log(0.896) =-(77.1667)(-0.109814)\approx8.47. $$

There are \(3(2)/2=3\) degrees of freedom. This test assesses whether the population correlations are all zero. It is not the Mauchly covariance-sphericity test, even though both procedures are sometimes described informally as tests of “sphericity.”

Assumptions, Interpretation, and a Common Pitfall

The chi-square calibrations above rely on independent multivariate normal observations and a fixed dimension as sample size grows. The covariance estimates must be nonsingular for the displayed determinants and log-likelihood ratios to be defined. When \(p\) is not small relative to \(n\), or when the data are markedly non-Gaussian, the nominal large-sample calibration may be poor; the formulas should not be treated as distribution-free tests.

A common mistake is to read “sphericity” as “identity covariance” and conclude that any rejection implies the data have a non-unit variance. The correction is to specify the null before interpreting the statistic: \(Q_{\mathrm{sph}}\) tests equality of eigenvalues while leaving their common scale free; \(Q_I\) tests a fixed covariance matrix; Bartlett’s correlation test tests zero correlations while allowing unequal marginal variances. These hypotheses are related, but they are not interchangeable.

Key takeaway: The Gaussian likelihood-ratio statistic for covariance sphericity is a scale-free comparison of the determinant with the \(p\)th power of the average eigenvalue. Its asymptotic degrees of freedom are \(p(p+1)/2-1\), one fewer than the identity-covariance test because spherical covariance retains an unknown common variance.

Check Your Understanding

Use the distinction between covariance sphericity, identity covariance, and identity correlation to answer these questions.

  1. How many free covariance parameters are in the unrestricted \(p\)-variate model, and how many are in the spherical null?
  2. Why is the sphericity likelihood-ratio statistic unchanged when the sample covariance is multiplied by a positive constant?
  3. If the population covariance is \(3I_p\), which of the spherical and identity-covariance null hypotheses are true?
  4. What does Bartlett’s test of correlation identity test, and why does it not require equal marginal variances?
  5. State two sampling conditions used for the chi-square calibration of the Gaussian likelihood-ratio tests.
Clinical Biostats