Tutorials › Multivariate Statistics (Graduate) › The Likelihood-Ratio Test Of Sphericity

Covariance Matrix Inference · Tutorial 243 of 975

The Likelihood-Ratio Test Of Sphericity

Learn how profiling the unknown scale leads to the likelihood-ratio statistic for testing whether a covariance matrix is a scalar multiple of the identity.

Intermediate 9 min read

What You'll Learn

  • State the Gaussian model and the sphericity null hypothesis.
  • Profile out the unknown mean and scalar variance.
  • Derive the likelihood ratio using the determinant and trace of the sample covariance.
  • Verify why the statistic is nonnegative and when it is zero.
  • Apply Wilks’ theorem and identify the degrees of freedom.
  • Avoid confusing the likelihood multiplier with the denominator used to report sample covariance.

Why Test for Sphericity?

A covariance matrix describes both the marginal variances of a multivariate measurement and the dependence among its components. The sphericity hypothesis is a particular, restrictive covariance structure: all directions have the same variance and distinct components are uncorrelated. Testing this structure is a way to assess whether the covariance can be represented by a single scale parameter rather than a general positive-definite matrix.

The likelihood-ratio test compares the best-fitting Gaussian model under that restriction with the best-fitting unrestricted Gaussian model. The mean is not assumed known, and the common variance is not specified in advance. Both nuisance parameters must therefore be handled in the likelihood calculation.

Model and Hypotheses

Let \(X_1,\ldots,X_n\) be independent observations from a \(p\)-variate normal distribution \(N_p(\mu,\Sigma)\), where \(\mu\) is an unrestricted mean vector and \(\Sigma\) is positive definite. We test, for \(p\geq 2\),

$$ H_0:\ \Sigma=\sigma^2 I_p\ \text{for some }\sigma^2>0 \qquad\text{against}\qquad H_1:\ \Sigma\text{ is any positive-definite matrix}. $$

Here \(I_p\) is the \(p\times p\) identity matrix. Under the null, each coordinate has variance \(\sigma^2\), and all distinct coordinates have covariance zero. Define the sample mean and centered scatter matrix by

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

Assume \(n>p\) and that \(A\) is positive definite, as occurs with probability one under a nonsingular multivariate normal model when \(n-1\geq p\). This condition ensures that the unrestricted covariance maximum-likelihood estimate is positive definite and the determinant in the test statistic is nonzero. Write \(S=A/n\) for that maximum-likelihood estimate. The commonly reported unbiased sample covariance \(A/(n-1)\) is a positive scalar multiple of \(S\); the statistic below is unchanged if it is used in place of \(S\).

Definition: The Gaussian likelihood-ratio statistic is \(\Lambda=L_0/L_1\), where \(L_0\) is the maximized likelihood over parameters satisfying \(H_0\), and \(L_1\) is the maximized likelihood over the unrestricted model. Thus \(0<\Lambda\leq 1\), and small values provide evidence against \(H_0\). It is customary to work with \(-2\log\Lambda\), for which large values are evidence against the null.

Deriving the Likelihood Ratio

The joint likelihood, apart from no omitted parameter-dependent terms, is

$$ L(\mu,\Sigma) =(2\pi)^{-np/2}|\Sigma|^{-n/2} \exp\left\{-\frac{1}{2}\sum_{i=1}^n (X_i-\mu)^\mathsf{T}\Sigma^{-1}(X_i-\mu)\right\}. $$

For fixed positive-definite \(\Sigma\), the quadratic sum is minimized at \(\mu=\bar X\), so profiling out the mean replaces the sum of quadratic forms by \(\operatorname{tr}(\Sigma^{-1}A)\). The resulting profile likelihood is

$$ L(\bar X,\Sigma) =(2\pi)^{-np/2}|\Sigma|^{-n/2} \exp\left\{-\frac{1}{2}\operatorname{tr}(\Sigma^{-1}A)\right\}. $$

In the unrestricted model its maximizer is \(\widehat\Sigma=S=A/n\). To verify this maximum, write \(\Sigma=S^{1/2}CS^{1/2}\), where \(C\) is positive definite with eigenvalues \(c_1,\ldots,c_p>0\). Since \(A=nS\), the parameter-dependent part of minus twice the profile log-likelihood is

$$ n\left(\log|S|+\sum_{j=1}^p\log c_j+\sum_{j=1}^p\frac{1}{c_j}\right). $$

For each \(c>0\), the function \(\log c+1/c\) has derivative \((c-1)/c^2\), so it decreases up to \(c=1\) and increases afterward. Its minimum is at \(c=1\). Consequently the unrestricted likelihood is maximized at \(C=I_p\), or \(\Sigma=S\).

Under \(H_0\), put \(\Sigma=\tau I_p\), with \(\tau>0\). The profile log-likelihood, omitting only terms constant in \(\tau\), is

$$ \ell_0(\tau)=-\frac{np}{2}\log\tau-\frac{\operatorname{tr}(A)}{2\tau}. $$

Its derivative is \(-np/(2\tau)+\operatorname{tr}(A)/(2\tau^2)\), which vanishes at \(\widehat\tau=\operatorname{tr}(A)/(np)\). The second derivative there is negative, and the log-likelihood tends to minus infinity at both endpoints \(\tau\downarrow0\) and \(\tau\uparrow\infty\), so this is the maximum. In terms of \(S\), \(\widehat\tau=\operatorname{tr}(S)/p\). At the unrestricted maximum, \(\operatorname{tr}(S^{-1}A)=np\). At the restricted maximum, \(\operatorname{tr}(A)/\widehat\tau=np\) as well. Thus the exponential factors in the two maximized likelihoods agree; their determinant factors give the likelihood ratio.

Theorem: Under the stated Gaussian model and positive-definiteness condition, the likelihood-ratio statistic for sphericity is $$ \Lambda= \left\{\frac{|S|}{\left(\operatorname{tr}(S)/p\right)^p}\right\}^{n/2}, \qquad -2\log\Lambda =n\left[p\log\left(\frac{\operatorname{tr}(S)}{p}\right)-\log|S|\right]. $$ The same expressions result if \(S\) is replaced by \(A/(n-1)\).

To see the cancellation explicitly, at the unrestricted maximum the covariance determinant is \(|S|\), whereas at the restricted maximum it is \(\widehat\tau^p\). Both maximized likelihoods have the same exponential factor \(\exp(-np/2)\) and the same normalizing constant. Therefore \(\Lambda=(|S|/\widehat\tau^p)^{n/2}\), yielding the displayed formula.

The statistic is unchanged by multiplying \(S\) by any positive constant \(a\): its determinant gains a factor \(a^p\), and \((\operatorname{tr}(S)/p)^p\) gains the same factor. This proves the claim about using either covariance denominator. It also shows why the test assesses shape relative to scale, not the overall magnitude of the variances.

Why the Statistic Is Nonnegative

Let \(\lambda_1,\ldots,\lambda_p\) be the positive eigenvalues of \(S\). The arithmetic–geometric mean inequality gives \((\lambda_1+\cdots+\lambda_p)/p\geq(\lambda_1\cdots\lambda_p)^{1/p}\). Raising both sides to the power \(p\) shows \[ \left(\frac{\operatorname{tr}(S)}p\right)^p\geq |S|. \] Taking logarithms proves \(-2\log\Lambda\geq0\). Equality holds precisely when all the eigenvalues are equal, that is, when the observed covariance matrix itself is spherical. This is also consistent with the likelihood ratio being no greater than one.

Worked Example: A Two-Dimensional Covariance Estimate

Suppose \(n=12\), \(p=2\), and the maximum-likelihood sample covariance is \(S=\operatorname{diag}(4,1)\). Compute the likelihood ratio and its log statistic.

The determinant is \(|S|=4\), and the average eigenvalue, equivalently \(\operatorname{tr}(S)/p\), is \((4+1)/2=2.5\). Hence

$$ \frac{|S|}{(\operatorname{tr}(S)/p)^p} =\frac{4}{(2.5)^2} =\frac{4}{6.25} =0.64. $$

It follows that \(\Lambda=0.64^{12/2}=0.64^6\), and

$$ -2\log\Lambda =-12\log(0.64) =5.355445231\ldots \approx 5.3554. $$

The statistic is positive because the two eigenvalues differ. The scale of the covariance estimate does not affect this calculation: multiplying both eigenvalues by the same positive constant leaves the ratio \(0.64\) unchanged.

Worked Example: Exact Sphericity in Three Dimensions

Suppose \(p=3\), \(n=15\), and \(S=\operatorname{diag}(2,2,2)\). Then \(|S|=2^3=8\) and \(\operatorname{tr}(S)/p=6/3=2\). Therefore

$$ \frac{|S|}{(\operatorname{tr}(S)/p)^p} =\frac{8}{2^3}=1, \qquad \Lambda=1^{15/2}=1, \qquad -2\log\Lambda=0. $$

The restricted and unrestricted maximum-likelihood estimates coincide: \(S=2I_3\). The data covariance is exactly spherical, so imposing the null restriction does not reduce the maximized likelihood.

Worked Example: Three Unequal Eigenvalues

For \(p=3\), \(n=20\), let \(S=\operatorname{diag}(1,2,3)\). Its trace is \(6\), its determinant is \(6\), and its average eigenvalue is \(2\). Thus

$$ \frac{|S|}{(\operatorname{tr}(S)/p)^p} =\frac{6}{2^3} =\frac{3}{4}, \qquad -2\log\Lambda =-20\log\left(\frac{3}{4}\right) =20\log\left(\frac{4}{3}\right) \approx 5.7536. $$

The determinant-to-trace ratio is below one, as required. The statistic records how far the eigenvalues depart jointly from equality; it is not a sum of their raw differences and is invariant to their common scale.

Asymptotic Calibration

Under the null, the covariance matrix has one free parameter, \(\sigma^2\). The unrestricted covariance matrix has \(p(p+1)/2\) distinct free entries. The mean contributes \(p\) nuisance parameters to both models, so it does not change the difference in parameter dimensions. The difference is therefore \(p(p+1)/2-1\).

Theorem (Wilks’ theorem): If \(p\) is fixed, the observations are independent and identically distributed from \(N_p(\mu,\Sigma)\), and the true covariance satisfies \(\Sigma=\sigma^2 I_p\) with \(\sigma^2>0\), then as \(n\to\infty\), $$ -2\log\Lambda \xrightarrow{d} \chi^2_{\,p(p+1)/2-1}. $$

The conditions place the null parameter in the interior of the positive-definite covariance model and give a regular, identifiable finite-dimensional likelihood problem. The chi-square approximation is asymptotic, not an exact finite-sample distribution. For example, when \(p=3\), the reference degrees of freedom are \(3(4)/2-1=5\). A large observed statistic is compared with the upper tail of the appropriate chi-square distribution.

Common Pitfalls and Interpretation

  • Reversing the determinant ratio. The null-to-unrestricted likelihood ratio uses \(|S|/(\operatorname{tr}(S)/p)^p\), which is at most one. Reversing it would make \(\Lambda\) exceed one and produce a negative value for \(-2\log\Lambda\). Check the direction before interpreting the result.
  • Substituting \(n-1\) for \(n\) in the likelihood statistic. The likelihood is based on \(n\) independent observations and gives the multiplier \(n\). Using \(A/(n-1)\) as the reported covariance does not change the statistic, but it does not replace that likelihood multiplier by \(n-1\).
  • Calling a nonzero statistic proof of nonsphericity. A nonzero value merely means the observed covariance estimate is not exactly spherical. Statistical evidence is assessed by calibrating the statistic under the null, with due attention to the fact that the chi-square reference is asymptotic.

The determinant summarizes the product of the covariance eigenvalues, while the trace summarizes their sum. Their scale-free ratio is one only when all eigenvalues match and decreases as they become less equal. This gives the likelihood-ratio test a direct geometric interpretation while retaining a principled likelihood comparison. The test addresses the specified covariance restriction; interpreting a particular result or examining diagnostic implications requires additional context.

Check Your Understanding

Use the determinant–trace expression and the assumptions stated above to answer these questions.

  1. For a positive-definite \(S\), why must \(|S|/(\operatorname{tr}(S)/p)^p\) be no greater than one?
  2. If \(S\) is multiplied by a positive constant, show why the likelihood-ratio statistic is unchanged.
  3. For \(p=4\), how many degrees of freedom does Wilks’ theorem give for the sphericity test?
  4. Why does the likelihood statistic use the multiplier \(n\), even when the reported sample covariance uses denominator \(n-1\)?
  5. For \(S=\operatorname{diag}(1,1,4)\), calculate the determinant-to-trace ratio before raising it to the power \(n/2\).
Clinical Biostats