Why an Unknown Mean Changes the Covariance Test
A covariance test asks whether the observed spread and dependence among coordinates are compatible with a specified covariance matrix. If the population mean is also unknown, it must be estimated under both the null model and the unrestricted model. This has a direct consequence: covariance is assessed around the fitted mean, so the relevant scatter matrix is centered rather than formed around the origin.
That centering removes one degree of freedom. It does not, however, mean that every occurrence of the sample size \(n\) in the likelihood-ratio formula should be replaced by \(n-1\). The likelihood uses all \(n\) observations; the centered scatter has a Wishart distribution with \(n-1\) degrees of freedom. Keeping these two roles separate is essential.
The notation \(A\) will denote the centered scatter matrix. The conventional unbiased sample covariance is \(S=A/(n-1)\); it is not the maximum-likelihood estimate in this model. When \(n>p\), \(A\) is positive definite with probability one under a nonsingular multivariate normal model, and the unrestricted covariance likelihood has a finite maximum. The derivation below assumes this condition.
Profiling the Mean and Maximizing the Covariance Likelihood
The joint likelihood, apart from its usual normalizing constant, is \(L(\mu,\Sigma)\propto|\Sigma|^{-n/2}\exp\{-\frac12\sum_i(X_i-\mu)'\Sigma^{-1}(X_i-\mu)\}\). For a fixed positive-definite \(\Sigma\), the quadratic term can be decomposed exactly:
The second term on the right is nonnegative and equals zero only at \(\mu=\bar X\). Thus, for every fixed covariance matrix, the likelihood is maximized over the mean at the sample mean. This holds under the null and under the unrestricted alternative, so profiling out the mean leaves the same centered scatter matrix in both likelihoods.
To verify that this is a global maximum, take any positive-definite \(\Sigma\) and let \(b_1,\ldots,b_p\) be the eigenvalues of \(B=\Sigma^{-1/2}\widehat\Sigma_{\mathrm{MLE}}\Sigma^{-1/2}\). Since \(A=n\widehat\Sigma_{\mathrm{MLE}}\), subtracting the profiled log-likelihood at \(\widehat\Sigma_{\mathrm{MLE}}\) from the one at \(\Sigma\) gives
The inequality follows from \(\log t\leq t-1\) for \(t>0\), with equality only at \(t=1\). Hence the displayed estimate is the unique unrestricted maximizer. Proof complete. \(\square\)
Under \(H_0\), the profiled likelihood is evaluated at \(\Sigma_0\); under the alternative, it is evaluated at \(A/n\). Define the likelihood ratio as the maximized null likelihood divided by the maximized unrestricted likelihood, so \(0\leq\Lambda\leq1\).
Indeed, the profiled likelihood at the null is proportional to \( |\Sigma_0|^{-n/2}\exp\{-\operatorname{tr}(\Sigma_0^{-1}A)/2\} \). At the unrestricted maximum it is proportional to \( |A/n|^{-n/2}\exp\{-np/2\} \). Taking their ratio proves the expression for \(\Lambda\). Taking \(-2\) times its logarithm gives \( n\log(|\Sigma_0|/|\widehat\Sigma_{\mathrm{MLE}}|)+\operatorname{tr}(\Sigma_0^{-1}A)-np \). Since \(A=n\widehat\Sigma_{\mathrm{MLE}}\) and \( |\Sigma_0^{-1}\widehat\Sigma_{\mathrm{MLE}}|=|\widehat\Sigma_{\mathrm{MLE}}|/|\Sigma_0| \), this is precisely the stated log form. Proof complete. \(\square\)
The formula can also be expressed using the unbiased sample covariance \(S=A/(n-1)\). Substitution gives
The factor \((n-1)/n\) appears because the likelihood maximizer is \(A/n\), not \(S\). Dropping that factor while using \(S\) changes the statistic.
Why the Centered Scatter Has \(n-1\) Degrees of Freedom
For clarity, a Wishart distribution \(W_p(\Sigma,\nu)\) is the distribution of a sum of \(\nu\) independent outer products \(Y_jY_j'\), where each \(Y_j\sim N_p(0,\Sigma)\). In the present model, the centered scatter has distribution \(A\sim W_p(\Sigma,n-1)\). The reason is that centering removes the component in the direction of the sample mean.
To see this, arrange the centered observations around \(\mu\) as the rows of an \(n\times p\) matrix \(Z\). Choose an orthogonal \(n\times n\) matrix \(Q\) whose first row is \(n^{-1/2}(1,\ldots,1)\), and write \(Y=QZ\). Orthogonal transformation preserves the joint normal distribution across the rows, so the rows of \(Y\) are independent \(N_p(0,\Sigma)\) vectors. The first row represents the sample-mean direction. The remaining rows represent the \(n-1\) orthogonal residual directions. Since \(I_n-\mathbf{1}\mathbf{1}'/n\) projects onto those residual directions,
This is a sum of \(n-1\) independent normal outer products, which proves the claimed Wishart distribution. \(\square\)
The likelihood-ratio expression and the scatter distribution therefore involve \(n\) and \(n-1\) for different reasons. The exponent \(n/2\) in the likelihood comes from the \(n\) independent observations. The \(n-1\) degrees of freedom arise from the \(n-1\) residual directions left after estimating the mean. The likelihood maximizer is \(A/n\), whereas \(A/(n-1)\) is unbiased for \(\Sigma\).
Worked Calculations
Worked Example: A Univariate Covariance Test with an Unknown Mean
Suppose \(n=4\) observations are \(1,2,4,5\), and test the specified variance \(\sigma_0^2=4\). Here \(p=1\), so covariance is variance.
The sample mean is \(\bar x=(1+2+4+5)/4=3\). The centered scatter is \(A=(1-3)^2+(2-3)^2+(4-3)^2+(5-3)^2=4+1+1+4=10\). Thus the maximum-likelihood variance is \(A/n=10/4=2.5\), while the unbiased sample variance is \(A/(n-1)=10/3\).
Using the likelihood-ratio formula, \( \Lambda=(2.5/4)^{4/2}\exp\{4/2-10/(2\cdot4)\} \). The power term is \(0.625^2=0.390625\), and the exponential term is \(\exp(0.75)\), so \( \Lambda=0.390625\exp(0.75)\approx0.827 \). Equivalently, \(-2\log\Lambda\approx0.380\). The centered scatter has \(n-1=3\) degrees of freedom, though the likelihood exponent is \(n/2=2\).
Worked Example: A Two-Dimensional Sample
Take \(n=4\) observations in two dimensions: \((1,0),(-1,0),(0,1),(0,-1)\). Test \(H_0:\Sigma=I_2\), with the mean unknown.
The observations sum to \((0,0)\), so \(\bar X=(0,0)\). Adding their outer products gives \( A=\begin{pmatrix}1&0\\0&0\end{pmatrix}+\begin{pmatrix}1&0\\0&0\end{pmatrix}+\begin{pmatrix}0&0\\0&1\end{pmatrix}+\begin{pmatrix}0&0\\0&1\end{pmatrix}=2I_2 \). Therefore \(\widehat\Sigma_{\mathrm{MLE}}=A/4=I_2/2\), with determinant \(1/4\). Also \(\operatorname{tr}(I_2^{-1}A)=4\).
The likelihood ratio is \( \Lambda=((1/4)/1)^{4/2}\exp\{4\cdot2/2-4/2\}=(1/4)^2\exp(2)=\exp(2)/16\approx0.462 \). Thus \(-2\log\Lambda=2\log(16)-4\approx1.545\). The centered scatter has \(n-1=3\) degrees of freedom; the MLE still divides the scatter by \(n=4\).
Worked Example: Why Centering Matters When the Mean Is Not Zero
Suppose the three univariate observations are \(2,4,6\), and the null variance is \(\sigma_0^2=4\). The mean is unknown and is estimated by \(\bar x=4\).
The centered scatter is \(A=(2-4)^2+(4-4)^2+(6-4)^2=8\), so the MLE variance is \(8/3\). In contrast, the uncentered sum of squares about zero is \(2^2+4^2+6^2=56\); it is not the scatter to use when the mean is profiled out.
The likelihood ratio is \( \Lambda=((8/3)/4)^{3/2}\exp\{3/2-8/(2\cdot4)\}=(2/3)^{3/2}\exp(1/2)\approx0.897 \). The sample covariance \(S=A/(n-1)\) equals \(4\), but the likelihood estimate is \(8/3\). This example shows both why the observations must be centered and why the covariance MLE must not be confused with the unbiased estimate.
Common Pitfalls and Practical Interpretation
The statistic measures how far the fitted covariance is from the specified covariance on a scale that accounts for both determinant and trace. The determinant term reflects overall volume, while the trace term reflects the total standardized variation relative to \(\Sigma_0\). Their combination is nonnegative: if \(b_1,\ldots,b_p\) are the eigenvalues of \(\Sigma_0^{-1/2}\widehat\Sigma_{\mathrm{MLE}}\Sigma_0^{-1/2}\), then \( -2\log\Lambda=n\sum_j(b_j-\log b_j-1)\geq0 \), because \(t-\log t-1\geq0\) for \(t>0\). Equality holds exactly when \(\widehat\Sigma_{\mathrm{MLE}}=\Sigma_0\).
- Using uncentered observations. Treating \(\sum_iX_iX_i'\) as scatter when the mean is unknown incorrectly forces the reference point to zero. The fitted mean is \(\bar X\), so use \(A=\sum_i(X_i-\bar X)(X_i-\bar X)'\).
- Replacing \(n\) everywhere by \(n-1\). Estimating the mean changes the scatter’s degrees of freedom, not the number of independent observations in the likelihood. Keep the likelihood exponent \(n/2\), and use \(A/n\) for the unrestricted MLE.
- Using the unbiased covariance as the MLE. \(S=A/(n-1)\) is unbiased, but the likelihood is maximized at \(A/n\). If writing the statistic with \(S\), retain the factor \((n-1)/n\).
- Ignoring a singular scatter matrix. If \(n\leq p\), the centered scatter is singular. The unrestricted positive-definite covariance likelihood then has no finite maximum, so the ordinary likelihood-ratio derivation above does not apply.
For a specified covariance test, the central consequence of an unknown mean is therefore precise: profiling the mean replaces origin-based scatter with centered scatter, and the latter has \(n-1\) residual degrees of freedom. The likelihood-ratio formula follows from that centered scatter, while its likelihood exponent continues to reflect the full sample size \(n\).
Check Your Understanding
Work through these questions by identifying which quantities come from profiling the mean and which come from the likelihood.
- For independent \(p\)-variate normal observations with unknown mean, write the centered scatter matrix and the maximum-likelihood covariance estimate.
- Why does the centered scatter have \(n-1\) Wishart degrees of freedom, even though the likelihood exponent is \(n/2\)?
- For the specified-covariance test, what is the likelihood ratio \(\Lambda\) in terms of \(A\), \(\Sigma_0\), \(n\), and \(p\)?
- If the unbiased sample covariance \(S\) is used in the log-likelihood-ratio statistic, which scaling factor must accompany it?
- Why does the usual unrestricted covariance likelihood-ratio derivation fail when \(n\leq p\)?