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.
Write \(\bar X=n^{-1}\sum_{i=1}^n X_i\), and define the residual sum of squares
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
For any fixed positive \(\sigma^2\), the sum of squared deviations is minimized at \(\mu=\bar x\), since
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
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\).
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.
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\),
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\),
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
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
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.
Check Your Understanding
For each problem, use the unknown-mean normal model and show the intermediate calculations before checking the answer.
- 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.)
- 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.)
- 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.)
- 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\).)
- 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.)