Tutorials › VEE Mathematical Statistics › Likelihood Ratio Tests For A Normal Variance

VEE Mathematical Statistics · Likelihood Ratio Tests · Tutorial 640 of 880

Likelihood Ratio Tests For A Normal Variance

Learn to construct and interpret the likelihood ratio test for a normal variance while accounting for an unknown mean and the chi-square calibration.

Advanced 12 min read

What You'll Learn

  • Profile the normal likelihood over an unknown mean and variance.
  • Distinguish the variance maximum-likelihood estimate from the unbiased sample variance.
  • Express the likelihood ratio using the residual sum of squares and the hypothesized variance.
  • Use the chi-square distribution with the correct degrees of freedom to calibrate the test.
  • Recognize why the likelihood ratio test rejects in both tails for a two-sided variance alternative.
  • Handle the special case in which all observed values are equal.

Why Test a Variance With an Unknown Mean?

A variance test asks whether the spread of observations is consistent with a specified value. In practice, the center of the distribution may not be specified. For example, a hypothetical quality-control study might test whether the variability in a measurement process equals a target variance while the process mean remains unknown. The likelihood ratio test handles this nuisance mean by maximizing the likelihood over it under both the null and the unrestricted model.

The key is to distinguish two roles of the residual sum of squares. Its ratio to the hypothesized variance has a chi-square distribution under the null, with \(n-1\) degrees of freedom. In the likelihood ratio, however, the unrestricted variance estimate is the residual sum of squares divided by \(n\), not \(n-1\). These facts are compatible: one concerns a maximum-likelihood estimate, and the other concerns the sampling distribution of a sum of squared residuals.

Model and hypotheses: Let \(X_1,\ldots,X_n\) be independent observations from \(N(\mu,\sigma^2)\), where \(\mu\) is unknown and \(\sigma^2>0\). For a specified \(\sigma_0^2>0\), consider \(H_0:\sigma^2=\sigma_0^2\) against the two-sided alternative \(H_1:\sigma^2\ne\sigma_0^2\). The usual test assumes \(n\ge 2\) and independent observations from this normal model.

Write \(\bar X=n^{-1}\sum_{i=1}^n X_i\), and define the residual sum of squares

$$ Q=\sum_{i=1}^n (X_i-\bar X)^2. $$

When \(Q>0\), the unbiased sample variance is \(S^2=Q/(n-1)\), whereas the unrestricted maximum-likelihood estimate of \(\sigma^2\) is \(Q/n\). The distinction in denominators matters when deriving the likelihood ratio.

Deriving the Likelihood Ratio

For observed values \(x_1,\ldots,x_n\), the likelihood is

$$ L(\mu,\sigma^2) =(2\pi\sigma^2)^{-n/2} \exp\left\{-\frac{1}{2\sigma^2}\sum_{i=1}^n(x_i-\mu)^2\right\}. $$

For any fixed positive \(\sigma^2\), the sum of squared deviations is minimized at \(\mu=\bar x\), since

$$ \sum_{i=1}^n(x_i-\mu)^2 =\sum_{i=1}^n(x_i-\bar x)^2+n(\bar x-\mu)^2 \ge Q. $$

Thus the maximizing mean is \(\bar x\), both under the null and in the unrestricted model. Under \(H_0\), the variance is fixed at \(\sigma_0^2\). In the unrestricted model, maximizing over the variance gives \(Q/n\) if \(Q>0\). To see this, the profile log-likelihood, after setting \(\mu=\bar x\), is

$$ \ell(\bar x,\sigma^2) =-\frac n2\log(2\pi)-\frac n2\log(\sigma^2)-\frac{Q}{2\sigma^2}. $$

Its derivative with respect to \(\sigma^2\) is \(-n/(2\sigma^2)+Q/(2(\sigma^2)^2)\). Setting this equal to zero gives \(\widehat{\sigma}^2=Q/n\). The derivative is positive below \(Q/n\) and negative above it, confirming a maximum when \(Q>0\).

Likelihood ratio: For \(Q>0\), define \(\lambda\) as the supremum of the likelihood under \(H_0\) divided by its unrestricted supremum. With \(T=Q/\sigma_0^2\), the ratio is
$$ \lambda =\left(\frac{Q}{n\sigma_0^2}\right)^{n/2} \exp\left(\frac n2-\frac{Q}{2\sigma_0^2}\right) =\left(\frac{T}{n}\right)^{n/2}\exp\left(\frac{n-T}{2}\right). $$

The likelihood ratio is at most 1, with values nearer 0 indicating greater disagreement between the data and the null model. The likelihood ratio test rejects \(H_0\) for sufficiently small \(\lambda\), using a cutoff chosen to give the desired significance level.

Why the Statistic Has a Chi-Square Distribution

Under \(H_0\), the observations have the form \(X_i=\mu+\varepsilon_i\), where the independent errors have distribution \(N(0,\sigma_0^2)\). Subtracting \(\bar X\) removes the component of the observation vector in the direction of the constant vector. The remaining residual vector lies in an \(n-1\) dimensional subspace. For a normal sample, the squared length of that residual vector, divided by \(\sigma_0^2\), has a chi-square distribution with one degree of freedom for each dimension of that subspace.

Theorem: Under \(H_0\), with independent normal observations and unknown mean,
$$ T=\frac{Q}{\sigma_0^2} =\frac{(n-1)S^2}{\sigma_0^2} \sim\chi^2_{n-1}. $$

This gives an exact finite-sample calibration, not an approximation. For a chosen significance level \(\alpha\), select \(c\) so that the null probability of \(\lambda(T)\le c\) is \(\alpha\), where \(T\sim\chi^2_{n-1}\). This calibration can be performed numerically. It is generally not correct to replace the likelihood ratio test automatically with an equal-tail chi-square test: the LRT cutoff is based on \(\lambda(T)\), not on equal tail probabilities.

The shape of the likelihood ratio explains why the test is two-sided. For \(T>0\),

$$ \frac{d}{dT}\log\lambda(T)=\frac{n-T}{2T}. $$

Therefore \(\lambda(T)\) increases for \(T<n\), reaches its maximum of 1 at \(T=n\), and decreases for \(T>n\). A small value can result from an unusually small residual sum of squares or an unusually large one. For a cutoff \(0<c<1\), the rejection region can be written \(T\le a\) or \(T\ge b\), where \(a<n<b\) solve \(\lambda(a)=\lambda(b)=c\). The chi-square distribution with \(n-1\) degrees of freedom determines the probability of those two tails.

Worked Tests and Interpretations

Worked Example: A Small Residual Sum of Squares

A hypothetical laboratory records six independent normal measurements, with unknown mean and variance. The observations are \(8,10,10,12,9,11\). Test \(H_0:\sigma^2=4\) against \(H_1:\sigma^2\ne4\), using an already calibrated likelihood-ratio cutoff \(c=0.15\). Reject when \(\lambda\le c\).

Method. Compute the sample mean, residual sum of squares, and \(T\), then evaluate the likelihood ratio. This method avoids treating the unbiased sample variance as the unrestricted variance MLE.

The sum of the observations is \(60\), so \(\bar x=60/6=10\). The squared residuals sum to \(Q=(8-10)^2+(10-10)^2+(10-10)^2+(12-10)^2+(9-10)^2+(11-10)^2=4+0+0+4+1+1=10\).

Correction: that sum is \(10\), so the test statistic is \(T=10/4=2.5\), not a value obtained by using a variance denominator. With \(n=6\),

$$ \lambda =\left(\frac{2.5}{6}\right)^3\exp\left(\frac{6-2.5}{2}\right) =\left(\frac{5}{12}\right)^3 e^{1.75} \approx 0.07234\times 5.7546 \approx 0.4164. $$

Since \(0.4164>0.15\), do not reject \(H_0\) at this cutoff. As a check, \(S^2=Q/(n-1)=10/5=2\), and \((n-1)S^2/\sigma_0^2=5(2)/4=2.5\), agreeing with \(T\). The decision is based on the specified cutoff; the cutoff is understood to have been calibrated for the intended significance level.

Worked Example: A Large Residual Sum of Squares

A hypothetical device produces five independent normal readings with unknown mean. The observed values are \(-2,-1,0,1,2\). Test \(H_0:\sigma^2=0.5\) against a two-sided alternative, using a calibrated cutoff \(c=0.02\).

Method. Profile out the unknown mean and use \(T=Q/\sigma_0^2\). This avoids incorrectly using a test statistic based on a known mean of zero merely because the observed sample happens to be centered at zero.

The sample mean is \(\bar x=0\), and \(Q=4+1+0+1+4=10\). Thus \(T=10/0.5=20\). The likelihood ratio is

$$ \lambda =\left(\frac{20}{5}\right)^{5/2}\exp\left(\frac{5-20}{2}\right) =4^{5/2}e^{-7.5} =32e^{-7.5} \approx 32(0.0005531) \approx 0.01770. $$

Because \(0.01770<0.02\), reject \(H_0\). The large \(T\) places the result in the upper-tail part of the LRT rejection region. As a check, \(S^2=10/4=2.5\), and \(4(2.5)/0.5=20\), which recovers the same statistic.

Worked Example: The Likelihood Ratio at Its Maximum

Eight independent normal observations, with unknown mean, are \(46,46,48,48,52,52,54,54\). Test \(H_0:\sigma^2=10\) against a two-sided alternative, using cutoff \(c=0.15\).

Method. Calculate \(T\) and then \(\lambda\); the likelihood ratio is largest at \(T=n\). This example highlights that the likelihood-ratio peak is not the same statement as the null expectation of \(T\).

The sample mean is \(400/8=50\). The sum of squared deviations is \(Q=16+16+4+4+4+4+16+16=80\). Consequently \(T=80/10=8\), which equals \(n\). Therefore

$$ \lambda =\left(\frac{8}{8}\right)^4\exp\left(\frac{8-8}{2}\right)=1. $$

Since \(1>0.15\), do not reject \(H_0\). The check using the unbiased variance gives \(S^2=80/7\), and \(7(80/7)/10=8\). Although \(T\sim\chi^2_7\) under the null and hence has expectation 7, the likelihood ratio reaches its maximum at \(T=n=8\); these are different facts.

The Equal-Observations Case and Common Traps

Worked Example: All Observations Are Equal

Suppose four independent normal measurements are all recorded as \(7\), and the null specifies \(\sigma^2=9\), with the mean unknown. Determine whether the unrestricted variance MLE and the usual finite likelihood-ratio formula exist.

Method. Inspect \(Q\) before applying the formula for the unrestricted MLE. This avoids silently substituting zero into a formula derived for \(Q>0\).

Here \(\bar x=7\) and \(Q=\sum_{i=1}^4(7-7)^2=0\). For \(\mu=7\), the likelihood is \((2\pi\sigma^2)^{-2}\), which tends to infinity as \(\sigma^2\) decreases to zero. Since the parameter space requires \(\sigma^2>0\), there is no finite unrestricted maximum and no unrestricted MLE. The displayed finite likelihood-ratio formula therefore does not apply as a ratio of finite maxima. In the extended supremum-ratio convention, the numerator is finite and the denominator is infinite, giving ratio zero. Under a continuous normal model, \(Q=0\) has probability zero, but it remains possible for a particular recorded data set.

Several errors are especially easy to make on an exam:

  • Using \(n-1\) in the unrestricted MLE. For \(Q>0\), the MLE is \(Q/n\). The unbiased sample variance is \(Q/(n-1)\). They serve different purposes.
  • Using \(n\) degrees of freedom. With an unknown mean estimated from the same observations, \(Q/\sigma_0^2\) has \(n-1\), not \(n\), degrees of freedom under the null.
  • Testing only one tail. The alternative \(\sigma^2\ne\sigma_0^2\) allows both less and greater variability. The LRT can reject for either a small or a large value of \(T\).
  • Ignoring the parameter space at \(Q=0\). The formula \(\widehat{\sigma}^2=Q/n\) is a finite MLE only when \(Q>0\) and the variance parameter is restricted to be positive.
Key takeaway: For \(Q>0\), calculate \(T=Q/\sigma_0^2=(n-1)S^2/\sigma_0^2\), evaluate \(\lambda=(T/n)^{n/2}\exp((n-T)/2)\), and calibrate the rejection rule using \(T\sim\chi^2_{n-1}\) under the null. Check \(Q>0\) before claiming an unrestricted variance MLE exists.

Check Your Understanding

For each problem, use the unknown-mean normal model and show the intermediate calculations before checking the answer.

  1. A sample of four independent normal observations is \(1,2,4,5\). Test \(H_0:\sigma^2=2\), using a calibrated cutoff \(c=0.90\). Find \(\bar x\), \(Q\), \(T\), and \(\lambda\), then state the decision. (Answer: \(\bar x=3,\ Q=10,\ T=5,\ \lambda\approx0.9477\); do not reject.)
  2. For \(n=10\), the observed unbiased sample variance is \(S^2=6\), and the null specifies \(\sigma_0^2=4\). Calculate \(T\) and the likelihood ratio, then decide using \(c=0.70\). (Answer: \(T=9(6)/4=13.5,\ \lambda=(1.35)^5e^{-1.75}\approx0.7792\); do not reject.)
  3. For \(n=6\), a sample has \(\bar x=12\) and \(Q=4\). Test \(H_0:\sigma^2=1\) using \(c=0.75\). Give \(S^2\), \(T\), and \(\lambda\), and state the decision. (Answer: \(S^2=4/5=0.8,\ T=4,\ \lambda=(4/6)^3e^1\approx0.8054\); do not reject.)
  4. Under \(H_0:\sigma^2=\sigma_0^2\), a sample of size \(n=8\) has \(S^2=3\), with \(\sigma_0^2=2\). What chi-square degrees of freedom and observed \(T\) should be used to calibrate the LRT? (Answer: \(7\) degrees of freedom and \(T=7(3)/2=10.5\).)
  5. Three independent normal observations are all equal to \(5\), and the variance parameter is restricted to be positive. Explain whether the unrestricted variance MLE exists and whether the finite-\(Q>0\) formula can be applied. (Answer: \(Q=0\); the likelihood is unbounded as \(\sigma^2\to0\), so no finite unrestricted MLE exists and the finite-\(Q>0\) formula does not apply.)
Clinical Biostats