Two Covariance Estimates, Two Denominators
In a multivariate regression, each case contributes a vector of responses, and the covariance matrix describes variation and association among the response variables after accounting for the mean model. Once the regression has been fitted, the residual sum-of-squares-and-cross-products matrix summarizes that remaining variation. There are two common ways to scale it: divide by the number of cases, or divide by the number of residual degrees of freedom. These choices answer different questions.
The first scaling arises from Gaussian maximum likelihood. The second corrects for the fact that fitting the regression mean uses some of the available information. To distinguish them precisely, consider a fixed-design multivariate linear model with \(n\) independent response vectors and \(q\) outcomes.
The projection formulation makes the definitions valid whenever the design has rank \(r\), regardless of how many columns are used to represent its column space. Under the model, \(M_XXB=0\), so \(\hat U=M_XU\). The matrix \(E\) is \(q\times q\); its diagonal entries are residual sums of squares for individual outcomes, and its off-diagonal entries are residual cross-products between outcomes.
Why the Gaussian MLE Uses \(n\)
For a positive-definite covariance matrix \(\Sigma\), the Gaussian log-likelihood, apart from constants that do not depend on the parameters, is
For each fixed \(\Sigma\), maximizing over the fitted mean is equivalent to minimizing the weighted residual term. The least-squares fitted matrix is \(P_XY\), and the corresponding residual SSCP is \(E\). After fitting the mean, the covariance-dependent part of the log-likelihood is therefore
Proof. Set \(A=E^{1/2}\Sigma^{-1}E^{1/2}\), which is positive definite. Because \(|\Sigma|=|E|/|A|\) and \(\operatorname{tr}(\Sigma^{-1}E)=\operatorname{tr}(A)\), maximizing the profiled log-likelihood over \(\Sigma\) is equivalent to maximizing
If the eigenvalues of \(A\) are \(\lambda_1,\ldots,\lambda_q>0\), this expression is the sum, over \(j\), of \(n\log(\lambda_j)/2-\lambda_j/2\). Each term has derivative \(n/(2\lambda_j)-1/2\), which is zero at \(\lambda_j=n\), and second derivative \(-n/(2\lambda_j^2)<0\). Thus each term is uniquely maximized at \(n\), so \(A=nI_q\). Rearranging gives \(\Sigma=E/n\). \(\square\)
This likelihood calculation explains the denominator: the Gaussian likelihood has \(n\) response vectors, and its covariance parameter is fitted using the residual SSCP from those \(n\) vectors. Maximum likelihood does not automatically correct for the estimation of the mean model. As the next result shows, that omission produces a downward bias.
The Bias Correction From Residual Degrees of Freedom
The projection \(M_X\) is symmetric and idempotent, and its rank and trace are both \(n-r=\nu\). These facts yield the expectation of \(E\) directly, without requiring a distributional approximation.
Proof. Since \(M_XXB=0\), \(E=U'M_XU\). Write \(u_i'\) for row \(i\) of \(U\), and \(m_{ij}\) for entry \((i,j)\) of \(M_X\). For response coordinates \(a\) and \(b\),
In the second equality, independence and zero means make \(E[U_{ia}U_{jb}]=0\) for \(i\ne j\); for \(i=j\), the expectation is \(\Sigma_{ab}\). Thus the matrix expectation is \(E[E]=\nu\Sigma\). Dividing by \(n\) gives \(E[E/n]=(\nu/n)\Sigma=(1-r/n)\Sigma\), so the bias is \(-r\Sigma/n\). Dividing by \(\nu\) gives \(E[E/\nu]=\Sigma\). \(\square\)
The factor \(\nu\) counts the dimensions of the observation space left after projecting out the fitted mean. It is not generally the number of columns in \(X\): redundant design columns do not increase its rank and do not use additional dimensions. The correction is based on \(\operatorname{rank}(X)\), not simply on a nominal column count.
Worked Examples
Worked Example: An Intercept-Only Model With Two Outcomes
Suppose \(n=5\) cases have two responses, and the fitted model contains an intercept only. Consider residual vectors \((1,0),(-1,0),(0,1),(0,-1),(0,0)\). Each response’s residuals sum to zero, as required for an intercept-only fit.
The residual SSCP is the sum of the outer products of these vectors:
Here \(r=1\), so \(\nu=5-1=4\). The maximum-likelihood estimate is \(E/5=\begin{pmatrix}0.4&0\\0&0.4\end{pmatrix}\), whereas the unbiased estimate is \(E/4=\begin{pmatrix}0.5&0\\0&0.5\end{pmatrix}\). In repeated samples under this model, the first estimate has expectation \((4/5)\Sigma\); the second has expectation \(\Sigma\). The observed matrices are estimates from these particular data, not their expectations.
Worked Example: A Regression Design Uses Two Dimensions
Let \(n=4\), with design columns \(1_4=(1,1,1,1)'\) and \(x=(1,-1,1,-1)'\). They are linearly independent, so \(r=2\) and \(\nu=4-2=2\). Two orthonormal vectors perpendicular to both design columns are \(u=(1,1,-1,-1)'/2\) and \(v=(1,-1,-1,1)'/2\). Take the two residual columns to be \(2u\) and \(\sqrt{2}v\).
Both residual columns are perpendicular to the design, so they are valid residuals. Since \(u'u=v'v=1\) and \(u'v=0\), their cross-product matrix is
Thus \(\hat\Sigma_{\mathrm{ML}}=E/4=\begin{pmatrix}1&0\\0&0.5\end{pmatrix}\), while the unbiased estimate is \(E/2=\begin{pmatrix}2&0\\0&1\end{pmatrix}\). There are four cases, but only two residual dimensions: the design has used two dimensions to fit the mean. The denominator changes the scale; it does not change the observed residual pattern or its relative outcome-specific sums of squares.
Worked Example: Too Few Residual Degrees of Freedom for a Nonsingular MLE
Suppose there are \(n=3\) cases, \(q=3\) outcomes, and an intercept-only design. Then \(r=1\) and \(\nu=2\). Every residual column lies in the two-dimensional subspace perpendicular to the intercept vector, so the \(3\times3\) residual matrix has rank at most two. Consequently \(E=\hat U'\hat U\) is singular, whatever the observed responses.
The unbiased estimate \(E/2\) is still defined and has expectation \(\Sigma\) under the model, but this particular estimate is necessarily singular. There is also no finite positive-definite Gaussian covariance MLE for these data. To see why, choose outcome coordinates in which \(E\) is diagonal with entries \(e_1,e_2,0\), where \(e_1,e_2>0\) in the typical rank-two case. Consider covariance matrices diagonal in the same coordinates with entries \(e_1/n,e_2/n,\epsilon\), for \(\epsilon>0\). The trace term in the profiled log-likelihood is \(2n\), while \(\log|\Sigma|=\log(e_1/n)+\log(e_2/n)+\log(\epsilon)\) tends to \(-\infty\) as \(\epsilon\) tends to zero. Therefore the log-likelihood increases without bound. The issue is not repaired by changing the denominator: the likelihood has no finite positive-definite maximizer.
Interpreting the Denominators
| Estimate | Formula | Statistical property and interpretation |
|---|---|---|
| Gaussian maximum-likelihood estimate | \(E/n\) | Maximizes the Gaussian likelihood when \(E\) is positive definite; its expectation is \((\nu/n)\Sigma\). |
| Degrees-of-freedom-corrected estimate | \(E/\nu\) | Unbiased for \(\Sigma\) when \(\nu>0\); it corrects for the dimensions used to fit the mean. |
Neither denominator is universally “the right one” without specifying the purpose. If the task is to report the Gaussian maximum-likelihood estimate, use \(n\). If an unbiased covariance estimate is required, use \(n-r\). The correction does not make every aspect of the estimate optimal, nor does unbiasedness mean that its realized value equals the true covariance. It means that, over repeated samples under the stated model and fixed design, its matrix expectation equals \(\Sigma\).
A frequent error is to argue that the likelihood uses \(n\) cases, so \(E/n\) must also be unbiased. The likelihood calculation establishes where the maximum occurs, not the expectation of that maximum across repeated samples. The expectation calculation instead shows that fitting the mean leaves only \(\nu\) residual dimensions, so \(E\) averages to \(\nu\Sigma\), not \(n\Sigma\). Another error is to subtract the number of outcomes \(q\) from \(n\). Here each case contributes a \(q\)-vector, but the regression mean removes \(r\) dimensions in the case space; the residual degrees of freedom are \(n-r\), not \(n-r-q\).
For a positive-definite Gaussian MLE, the residual SSCP must itself be positive definite. Under the continuous Gaussian model this occurs with probability one when \(\nu\ge q\). If \(\nu<q\), \(E\) must be singular, as in the third example, and the likelihood has no finite maximizer over positive-definite covariance matrices. The unbiased estimate \(E/\nu\) may still be defined, but it too will be singular in that situation.
Check Your Understanding
Answer each question using the fixed-design model and notation defined above.
- If \(n=18\) and \(\operatorname{rank}(X)=4\), what are the residual degrees of freedom and the denominator of the unbiased covariance estimate?
- Why does dividing \(E\) by \(n\) produce a downward-biased estimate when \(r>0\)?
- In what sense is \(E/(n-r)\) unbiased, and what does that statement not guarantee for one observed data set?
- If a design matrix has seven columns but rank five, how many residual degrees of freedom are there?
- What condition on the residual SSCP is needed for a finite positive-definite Gaussian covariance MLE, and what happens when \(n-r<q\)?