Tutorials › Multivariate Statistics (Graduate) › Likelihood-Ratio Test From Gaussian Likelihood

Hypothesis Testing in Linear Models · Tutorial 318 of 975

Likelihood-Ratio Test From Gaussian Likelihood

Learn how profiling the Gaussian likelihood turns nested coefficient restrictions into a likelihood-ratio statistic expressed through the determinants of the error and hypothesis sum-of-squares matrices.

Intermediate 10 min read

What You'll Learn

  • Define the likelihood ratio with the null model in the numerator.
  • Profile the matrix-normal likelihood over the unknown response covariance.
  • Relate restricted and unrestricted residual scatter matrices to E and H.
  • Derive the determinant-ratio form of the likelihood-ratio statistic.
  • Check positive-definiteness conditions and calculate the statistic from examples.
  • Distinguish the exact likelihood ratio from its later distributional calibration.

Why a Gaussian likelihood becomes a determinant ratio

In a multivariate linear model, a coefficient restriction changes the fitted mean matrix and therefore changes the residual scatter across responses. The Gaussian likelihood combines that scatter with the unknown covariance matrix of the responses. Once the covariance is maximized out, its contribution is summarized by a determinant. This is why the likelihood-ratio statistic for nested models can be written using the error and hypothesis sum-of-squares matrices, \(E\) and \(H\).

The direction of the ratio matters: throughout, the likelihood under the null (restricted) model is divided by the likelihood under the unrestricted model. The resulting statistic is at most one when the restricted model is nested in the unrestricted model.

Model and likelihood

Definition: Let \(Y\) be an \(n\times p\) matrix of observed responses, with \(p\) outcomes measured on each of \(n\) observational units. In the Gaussian multivariate linear model, $$ Y=XB+U, $$ where \(X\) is a fixed \(n\times k\) design matrix of rank \(k\), \(B\) is a \(k\times p\) coefficient matrix, and the rows of \(U\) are independent \(N_p(0,\Sigma)\) vectors for a positive-definite \(p\times p\) covariance matrix \(\Sigma\). A coefficient restriction defines a restricted model nested in the unrestricted model.

For a proposed mean matrix \(XB\), write its residual sum-of-squares and cross-products matrix as \(S(B)=(Y-XB)'(Y-XB)\). If \(S(B)\) is positive definite, the likelihood is

$$ L(B,\Sigma)=(2\pi)^{-np/2}|\Sigma|^{-n/2} \exp\!\left\{-\frac{1}{2}\operatorname{tr}\!\left[\Sigma^{-1}S(B)\right]\right\}. $$

The unrestricted fit gives the error matrix \(E\). Let \(S_R\) denote the residual cross-products matrix at the restricted maximum-likelihood fit. In the standard projection formulation of nested multivariate linear models, \(S_R=E+H\), where \(H\) is the hypothesis sum-of-squares and cross-products matrix. More generally, the likelihood-ratio identity below uses \(S_R\) directly and one may set \(H=S_R-E\); a projection formula for \(H\) requires the corresponding model structure.

Profiling out the covariance matrix

For a fixed fitted mean, the covariance matrix that maximizes the likelihood is \(S(B)/n\), provided \(S(B)\) is positive definite. The next result derives this fact and the resulting maximized likelihood.

Result: For fixed \(B\) with \(S(B)>0\), the maximum over positive-definite \(\Sigma\) occurs at \(\hat\Sigma(B)=S(B)/n\), and $$ \max_{\Sigma} L(B,\Sigma) =(2\pi e/n)^{-np/2}|S(B)|^{-n/2}. $$

To prove the result, omit terms in the log-likelihood that do not depend on \(\Sigma\). Maximizing it is equivalent to minimizing \(\log|\Sigma|+\operatorname{tr}(\Sigma^{-1}S(B)/n)\). Set \(A=S(B)/n\), which is positive definite, and \(T=A^{1/2}\Sigma^{-1}A^{1/2}\), also positive definite. The determinant identity gives \(\log|\Sigma|=\log|A|-\log|T|\), while the trace term is \(\operatorname{tr}(T)\). Thus the quantity to minimize is \(\log|A|+\operatorname{tr}(T)-\log|T|\). If \(t_1,\ldots,t_p\) are the positive eigenvalues of \(T\), then \(\operatorname{tr}(T)-\log|T|=\sum_{j=1}^p(t_j-\log t_j)\). For \(t>0\), the function \(t-\log t\) has derivative \(1-1/t\), decreases up to \(t=1\), and increases thereafter, so its minimum is \(1\). The sum is therefore minimized when every \(t_j=1\), or \(T=I\). This implies \(\Sigma=A=S(B)/n\). Substituting into the likelihood gives the displayed maximum. \(\square\)

Deriving the likelihood-ratio statistic

Theorem: Suppose the unrestricted and restricted Gaussian fits attain maxima with positive-definite residual cross-products \(E\) and \(S_R=E+H\), respectively. Define the likelihood ratio as the restricted maximum likelihood divided by the unrestricted maximum likelihood. Then $$ \Lambda=\left(\frac{|E|}{|E+H|}\right)^{n/2}, \qquad -2\log\Lambda=n\log\!\left(\frac{|E+H|}{|E|}\right). $$

Apply the profiled-likelihood result to each model. All factors \((2\pi e/n)^{-np/2}\) are identical and cancel in the ratio. The unrestricted profiled likelihood is proportional to \(|E|^{-n/2}\), and the restricted one to \(|E+H|^{-n/2}\). Dividing the latter by the former gives \(\Lambda=(|E|/|E+H|)^{n/2}\). Taking logarithms and multiplying by \(-2\) yields the second expression. This is an exact likelihood calculation; it does not, by itself, specify a reference distribution or a decision threshold. \(\square\)

For the usual nested projection formulation, let \(P_U\) and \(P_R\) be the orthogonal projection matrices onto the unrestricted and restricted mean spaces, with the restricted space contained in the unrestricted one. Then \(E=Y'(I-P_U)Y\) and \(E+H=Y'(I-P_R)Y\). Their difference is \(H=Y'(P_U-P_R)Y\). Since \(P_U-P_R\) is a symmetric idempotent matrix, for any vector \(a\in\mathbb R^p\), \(a'Ha=(Ya)'(P_U-P_R)(Ya)\geq 0\). Thus \(H\) is positive semidefinite. In particular, if \(E\) is positive definite, then \(E+H\) is positive definite as well, because for nonzero \(a\), \(a'(E+H)a\geq a'Ea>0\). These conditions ensure that both determinants in the likelihood ratio are positive.

Worked determinant calculations

Worked Example: A Two-Response Likelihood Ratio

Suppose a nested comparison has \(n=20\) units and the fitted cross-products matrices are $$ E=\begin{pmatrix}4&0\\0&23\end{pmatrix}, \qquad H=\begin{pmatrix}1&0\\0&52/5\end{pmatrix}. $$ Both matrices are positive semidefinite, and \(E\) is positive definite.

First calculate the determinants: \(|E|=4(23)=92\), and $$ E+H=\begin{pmatrix}5&0\\0&167/5\end{pmatrix}, \qquad |E+H|=5(167/5)=167. $$ Therefore \(\Lambda=(92/167)^{20/2}=(92/167)^{10}\). The log form is \(-2\log\Lambda=20\log(167/92)\approx 11.92\). The null likelihood is smaller than the unrestricted likelihood, as expected for this nested comparison.

Worked Example: Checking the Exponent and Rounding

Let \(n=12\) and suppose $$ E=\begin{pmatrix}5&0\\0&6\end{pmatrix}, \qquad H=\begin{pmatrix}1&0\\0&17/6\end{pmatrix}. $$ Then \(|E|=5(6)=30\), while \(E+H\) is diagonal with entries \(6\) and \(47/6\), so \(|E+H|=6(47/6)=47\).

The likelihood ratio is \(\Lambda=(30/47)^{12/2}=(30/47)^6\). Hence \(-2\log\Lambda=12\log(47/30)\approx 5.39\). The exponent in \(\Lambda\) is \(n/2=6\), whereas the multiplier in \(-2\log\Lambda\) is \(n=12\); confusing these two forms changes the result.

Worked Example: One Response as a Check

For a single response, the scatter matrices are scalars. Suppose \(n=10\), the unrestricted residual sum of squares is \(E=40\), and the restricted residual sum of squares is \(E+H=50\), so \(H=10\).

The determinant of a one-by-one matrix is its sole entry. Thus \(\Lambda=(40/50)^{10/2}=(4/5)^5=1024/3125=0.32768\). Equivalently, \(-2\log\Lambda=10\log(50/40)=10\log(1.25)\approx 2.23\). This scalar case confirms that the multivariate determinant expression reduces to the corresponding Gaussian residual-variance comparison.

Interpretation, conditions, and a common pitfall

The ratio measures the loss in maximized likelihood caused by imposing the restrictions. In a nested projection comparison with \(H\) positive semidefinite, \(E+H\) is at least as large as \(E\) in the positive-semidefinite ordering, and its determinant cannot be smaller when \(E\) is positive definite. Consequently \(0<\Lambda\leq 1\), and \(-2\log\Lambda\geq 0\). Equality holds when the restricted fit adds no hypothesis scatter, so that \(H=0\) in this formulation.

Positive definiteness is not a cosmetic technicality. If \(E\) is singular, the unrestricted covariance maximum may fail to be finite in the ordinary positive-definite parameter space, and the determinant formula cannot be used as written. A necessary dimensional condition for a full-rank residual scatter in the unrestricted model is \(n-k\geq p\), but this alone does not guarantee that the observed \(E\) is positive definite; that must be checked or assumed.

  • Pitfall: reversing the ratio. Writing \(|E+H|^{n/2}/|E|^{n/2}\) as \(\Lambda\) makes the null-to-unrestricted likelihood ratio exceed one in the usual nested case. The correction is to put the restricted maximum in the numerator: \(\Lambda=(|E|/|E+H|)^{n/2}\).
  • Pitfall: treating \(H\) as the restricted residual matrix. In the projection formulation, \(E\) is the unrestricted error matrix, \(H\) is the added hypothesis matrix, and the restricted residual matrix is \(E+H\).
  • Pitfall: using \(n/2\) in both displayed forms. The likelihood ratio has exponent \(n/2\); after taking \(-2\log\), the multiplier is \(n\).

For general coefficient restrictions, the likelihood ratio still follows by comparing the restricted and unrestricted maximized Gaussian likelihoods. The determinant identity uses their respective optimized residual cross-products. A convenient projection expression \(H=Y'(P_U-P_R)Y\) applies when the restricted mean space has the stated nested projection structure; it should not be assumed for an arbitrary restriction that couples response coefficients.

Check Your Understanding

Work through these questions using the definitions and conditions above.

  1. Why does maximizing over \(\Sigma\) leave a determinant of the residual cross-products in the profiled likelihood?
  2. If \(|E|=18\), \(|E+H|=27\), and \(n=8\), write \(\Lambda\) and \(-2\log\Lambda\) without evaluating them.
  3. In a nested projection formulation, explain why \(H=Y'(P_U-P_R)Y\) is positive semidefinite.
  4. What positive-definiteness condition is needed to use the displayed determinant likelihood ratio in its ordinary form?
  5. Why is the likelihood ratio at most one in the usual nested projection comparison?
Clinical Biostats