Tutorials › Multivariate Statistics (Graduate) › Likelihood-Ratio Tests Of Nested Covariance Restrictions

Covariance Matrix Inference · Tutorial 255 of 975

Likelihood-Ratio Tests Of Nested Covariance Restrictions

Derive likelihood-ratio statistics for nested Gaussian covariance models, work through three comparisons, and assess when the chi-square approximation is justified.

Intermediate 10 min read

What You'll Learn

  • Define a likelihood-ratio test for nested Gaussian covariance models.
  • Derive the exact statistic from the maximized Gaussian likelihoods.
  • Count degrees of freedom using the dimensions of the covariance models.
  • Calculate tests for diagonal, spherical, and compound-symmetry restrictions.
  • Identify regularity conditions behind Wilks’ chi-square calibration.
  • Recognize when a boundary or singularity invalidates the usual degrees of freedom.

Why Compare Nested Covariance Models?

Covariance assumptions often form a sequence of increasingly flexible models. For example, a spherical covariance matrix has one free variance parameter; a diagonal matrix allows a separate variance for each variable; and an unrestricted covariance matrix also allows all covariances. A likelihood-ratio test asks whether the additional flexibility in a larger model improves fit enough to justify its extra parameters.

The comparison is meaningful only when the models are nested: every covariance matrix allowed under the smaller model must also be allowed under the larger one. The test statistic measures the loss in maximized likelihood caused by imposing the smaller model’s restrictions. Its usual large-sample reference distribution is chi-square, with degrees of freedom determined by the difference in model dimensions—provided the models satisfy regularity conditions.

Definition and Exact Likelihood-Ratio Statistic

Definition: Suppose \(X_1,\ldots,X_n\) are independent observations from \(N_p(\mu,\Sigma)\). Let \(\mathcal M_0\subseteq\mathcal M_1\) be nested sets of positive-definite covariance matrices, with the same unrestricted mean vector \(\mu\) in both models. The likelihood-ratio statistic for \(H_0:\Sigma\in\mathcal M_0\) against \(H_1:\Sigma\in\mathcal M_1\) is \(\Lambda=L_0/L_1\), where \(L_j\) is the likelihood maximized over \(\mu\in\mathbb R^p\) and \(\Sigma\in\mathcal M_j\). The test statistic is \(T=-2\log\Lambda=2(\ell_1-\ell_0)\); large values count against \(H_0\).

Write \(\bar X=n^{-1}\sum_{i=1}^n X_i\) and \(S=n^{-1}\sum_{i=1}^n(X_i-\bar X)(X_i-\bar X)^\mathsf T\). The divisor is \(n\), because \(S\) is the unrestricted Gaussian maximum-likelihood estimator of the covariance matrix when the mean is unknown. For a fixed positive-definite \(\Sigma\), maximizing over \(\mu\) gives \(\hat\mu=\bar X\). Substitution into the log-likelihood yields

$$ \ell(\Sigma)=-\frac{np}{2}\log(2\pi)-\frac n2\log|\Sigma| -\frac n2\operatorname{tr}(\Sigma^{-1}S). $$

Let \(\widehat\Sigma_j\) be a covariance maximum-likelihood estimate in model \(\mathcal M_j\). Subtracting the two maximized log-likelihoods gives an exact expression, including when neither model is unrestricted.

Result: Provided the indicated maximum-likelihood estimates exist and are positive definite, \[ T=n\left\{\log\frac{|\widehat\Sigma_0|}{|\widehat\Sigma_1|} +\operatorname{tr}(\widehat\Sigma_0^{-1}S) -\operatorname{tr}(\widehat\Sigma_1^{-1}S)\right\}. \]

To verify it, substitute each estimate into the displayed log-likelihood. The constant \(-np\log(2\pi)/2\) appears in both models and cancels. The difference in log-determinant terms is \(n\log(|\widehat\Sigma_0|/|\widehat\Sigma_1|)/2\), and the difference in trace terms is \(n\{\operatorname{tr}(\widehat\Sigma_0^{-1}S)-\operatorname{tr}(\widehat\Sigma_1^{-1}S)\}/2\). Multiplying the log-likelihood difference by two proves the formula. Since the models are nested, \(L_0\leq L_1\), so \(T\geq0\).

When \(\mathcal M_1\) is the unrestricted covariance model, \(\widehat\Sigma_1=S\), assuming \(S\) is positive definite. Then \(\operatorname{tr}(S^{-1}S)=p\), and the expression reduces to

$$ T=n\left\{\log\frac{|\widehat\Sigma_0|}{|S|} +\operatorname{tr}(\widehat\Sigma_0^{-1}S)-p\right\}. $$

In many models the restricted estimate also satisfies \(\operatorname{tr}(\widehat\Sigma_0^{-1}S)=p\). This occurs, for example, when the model has a freely estimated overall scale and the likelihood score for that scale is zero at the maximum. In that case the statistic simplifies further to \(n\log(|\widehat\Sigma_0|/|S|)\). Do not assume this simplification without checking the model or the likelihood equations.

Degrees of Freedom and Wilks’ Theorem

The dimension of a covariance model is the number of locally free parameters needed to specify its covariance matrices. An unrestricted symmetric \(p\times p\) covariance matrix has \(p(p+1)/2\) distinct entries. For regular nested models with dimensions \(d_0\) and \(d_1\), the number of independent restrictions is \(q=d_1-d_0\).

Theorem (Wilks’ theorem for nested covariance models): Suppose the observations are independent and identically distributed as \(N_p(\mu,\Sigma)\), with fixed \(p\). Suppose the null covariance is an interior point of a smooth, identifiable model \(\mathcal M_0\) nested in a smooth, identifiable model \(\mathcal M_1\); both models have nonsingular Fisher information in local coordinates, and their dimensions are \(d_0\) and \(d_1\). Assume the maximum-likelihood estimates exist with probability tending to one and the usual local likelihood regularity conditions hold. Under \(H_0\), \(T\xrightarrow{d}\chi^2_q\), where \(q=d_1-d_0\). The common unrestricted mean contributes the same \(p\) parameters to both models and therefore does not change \(q\).

The dimension difference follows directly from local parameter counting. In regular local coordinates, the larger model has \(d_1\) free covariance coordinates, while the null model restricts those coordinates to a smooth subset with \(d_0\) free coordinates. Its local codimension is therefore \(d_1-d_0\), the number of independent restrictions. Wilks’ theorem calibrates the likelihood loss from those restrictions by a chi-square distribution with that codimension as its degrees of freedom. This is an asymptotic result, not an exact finite-sample distribution in general.

For example, an unrestricted covariance matrix in three dimensions has six parameters. A diagonal covariance matrix has three, so testing diagonality against the unrestricted model imposes three restrictions and has three asymptotic degrees of freedom. A parameter count is valid only when it describes the local dimension: redundant parameterizations, boundary points, or singular information can make the simple subtraction misleading.

Worked Comparisons

Worked Example: Testing a Diagonal Covariance Matrix

Suppose \(n=20\), \(p=2\), and the observed maximum-likelihood covariance estimate is \(S=\begin{pmatrix}4&1.2\\1.2&9\end{pmatrix}\). Test a diagonal covariance model against the unrestricted model.

Restricted estimate. Under the diagonal model, the maximum-likelihood estimates of the two variances are the diagonal entries of \(S\), so \(\widehat\Sigma_0=\begin{pmatrix}4&0\\0&9\end{pmatrix}\). Its determinant is \(36\). The unrestricted determinant is \(|S|=4(9)-(1.2)^2=36-1.44=34.56\).

Trace check. The inverse restricted estimate is \(\operatorname{diag}(1/4,1/9)\). Thus \(\operatorname{tr}(\widehat\Sigma_0^{-1}S)=4/4+9/9=2\), equal to \(p\). The unrestricted trace is also \(\operatorname{tr}(S^{-1}S)=2\).

Statistic and degrees of freedom. Therefore \(T=20\log(36/34.56)=20\log(25/24)\approx20(0.040822)=0.8164\). The unrestricted model has three covariance parameters and the diagonal model has two, so \(q=3-2=1\). The asymptotic reference distribution is \(\chi^2_1\). The small statistic indicates little likelihood loss from setting the covariance to zero, though a formal decision also requires a chosen significance level.

Worked Example: Equal Variances Within a Diagonal Model

Suppose \(n=30\) and the unrestricted diagonal model gives variance estimates \(1,2,3\). Compare the null model \(\Sigma=\sigma^2 I_3\), with one common variance, against the alternative model with three separate variances.

Under the alternative, \(\widehat\Sigma_1=\operatorname{diag}(1,2,3)\). Under the null, maximizing the likelihood over \(\sigma^2\) gives \(\widehat\sigma^2=(1+2+3)/3=2\), so \(\widehat\Sigma_0=2I_3\). Its determinant is \(2^3=8\), while \(|\widehat\Sigma_1|=1\cdot2\cdot3=6\). The null trace term is \(\operatorname{tr}((2I_3)^{-1}\widehat\Sigma_1)=(1+2+3)/2=3\), matching the alternative trace term \(3\).

It follows that \(T=30\log(8/6)=30\log(4/3)\approx30(0.287682)=8.6305\). The alternative has three covariance parameters and the null has one, giving \(q=2\). The reference distribution under the regular null is \(\chi^2_2\). This comparison tests equality of variances within the diagonal family; it does not test whether the off-diagonal covariances are zero against an unrestricted alternative.

Worked Example: Compound Symmetry Against an Unrestricted Covariance

Let \(n=25\), \(p=3\), and suppose \(S=\begin{pmatrix}4&1&0\\1&5&2\\0&2&6\end{pmatrix}\). Compare a compound-symmetry covariance model, with common diagonal \(v\) and common off-diagonal \(c\), against the unrestricted model.

The restricted model has two eigenvalues: \(v-c\) on the two-dimensional subspace perpendicular to \((1,1,1)^\mathsf T\), and \(v+2c\) in the direction of that vector. The corresponding observed sums of squares per eigenspace are \(\operatorname{tr}(S)-\mathbf 1^\mathsf TS\mathbf 1/3=15-21/3=8\) and \(\mathbf 1^\mathsf TS\mathbf 1/3=21/3=7\). Dividing each by its subspace dimension gives the restricted maximum-likelihood eigenvalues \(4\) and \(7\). Solving \(v-c=4\) and \(v+2c=7\) gives \(v=5\), \(c=1\), and hence \(\widehat\Sigma_0=4I_3+\mathbf 1\mathbf 1^\mathsf T\). Its eigenvalues are \(4,4,7\), so it is positive definite and has determinant \(112\).

The unrestricted determinant is \(|S|=4(30-4)-1(6-0)=104-6=98\). Also, \(\widehat\Sigma_0^{-1}=\tfrac14 I_3-\tfrac1{28}\mathbf 1\mathbf 1^\mathsf T\), so \(\operatorname{tr}(\widehat\Sigma_0^{-1}S)=15/4-21/28=3\). The unrestricted trace is \(3\) as well. Thus \(T=25\log(112/98)=25\log(8/7)\approx25(0.133531)=3.3383\). The unrestricted covariance has six parameters; compound symmetry has two. The dimension difference is \(q=4\), so the regular large-sample reference is \(\chi^2_4\).

Conditions, Interpretation, and a Common Pitfall

The usual chi-square calibration requires more than a nested pair of formulas. The covariance matrices must be positive definite at the null, the model dimensions must be well defined locally, and the true null parameter must not lie on a boundary where the model changes shape. The information must be nonsingular, and the likelihood must have the usual smooth local behavior. The independent Gaussian sampling model and fixed dimension are part of the stated calibration. If any of these conditions fail, the degrees-of-freedom subtraction may not give the null distribution; a boundary can, for example, lead to a nonstandard mixture rather than an ordinary chi-square law.

Common mistake: “The null has four fewer named parameters, so the test statistic must have a chi-square distribution with four degrees of freedom.” The correction is that parameter counting supplies the degrees of freedom only for a regular nested comparison. One must first identify the effective local dimensions and check the regularity assumptions. A parameter on the edge of its allowed range, a non-identifiable parameter, or a singular model can invalidate the ordinary Wilks calibration even when the models appear nested.

The likelihood-ratio framework is useful because it compares models on a common scale and applies to many covariance structures, including diagonal, block-diagonal, equal-variance, and compound-symmetry restrictions. It also separates two tasks: maximize the likelihood under each model, then calibrate the resulting loss using the dimension difference and the regularity conditions. Those tasks should not be conflated: a correct likelihood calculation does not by itself guarantee a reliable chi-square approximation.

Check Your Understanding

Use the definitions and conditions above to answer these questions.

  1. Why is the divisor \(n\), rather than \(n-1\), used in the Gaussian maximum-likelihood estimate \(S\)?
  2. A diagonal covariance model in four dimensions is compared with an unrestricted covariance model. What is the dimension difference?
  3. In the exact likelihood-ratio expression, when may the trace terms be omitted to obtain a log-determinant-only statistic?
  4. What regularity issue arises if the null covariance lies on the boundary of the positive-definite parameter space?
  5. Two nested covariance models have dimensions five and two. State the usual asymptotic degrees of freedom and one condition that must hold for this calibration to apply.
Clinical Biostats