Why Residual Covariance Has a Block-Matrix Form
When several target variables are adjusted for the same controls, the residuals are still a vector: each observation has one residual for each target. Their covariance matrix summarizes both the remaining variation in each target and the remaining association between targets. The covariance blocks of the original variables determine this matrix directly, without fitting a separate scalar regression for every pair.
The key operation is a Schur complement. Here it arises from a simple calculation: subtract from the target vector its best linear prediction from the controls, then calculate the covariance of what remains. The resulting formula also explains why the residual covariance matrix cannot have a negative variance in any linear combination of the residuals.
Setup and Definition
Let \(X\) be a \(p\)-dimensional random vector of target variables and \(Z\) a \(q\)-dimensional random vector of controls. Assume their joint distribution has finite second moments. For clarity, take both vectors to be centered, so \(E[X]=0\) and \(E[Z]=0\). Centering is equivalent to including an intercept when forming linear predictions.
Write the joint covariance matrix in blocks:
Assume \(\Sigma_{ZZ}\) is positive definite, hence invertible. This ensures that the linear projection coefficients on the controls are uniquely determined. The coefficient matrix for predicting \(X\) linearly from \(Z\) is \(\Sigma_{XZ}\Sigma_{ZZ}^{-1}\).
This is a population definition. It describes the residuals from the best linear prediction in mean-square error, not necessarily the residuals from a correctly specified conditional-mean model. The distinction matters when the joint distribution is not Gaussian or when the conditional mean is nonlinear.
Deriving the Residual Covariance
Set \(B=\Sigma_{XZ}\Sigma_{ZZ}^{-1}\), so \(R_X=X-BZ\). Covariance is bilinear, and the covariance blocks give \(\operatorname{Cov}(X,Z)=\Sigma_{XZ}\) and \(\operatorname{Cov}(Z,X)=\Sigma_{ZX}\). Expanding the covariance therefore gives:
To prove the formula, use \(R_X=X-BZ\) and expand each term:
Since \(\Sigma_{ZZ}\) is symmetric, its inverse is symmetric. Thus \(B^{\mathsf T}=\Sigma_{ZZ}^{-1}\Sigma_{ZX}\). Substituting \(B=\Sigma_{XZ}\Sigma_{ZZ}^{-1}\), the second and third terms are each \(\Sigma_{XZ}\Sigma_{ZZ}^{-1}\Sigma_{ZX}\). The final term is also that same matrix:
Consequently, one copy is subtracted twice and added once, leaving \(\operatorname{Cov}(R_X)=\Sigma_{XX}-\Sigma_{XZ}\Sigma_{ZZ}^{-1}\Sigma_{ZX}\). This proves the result. \(\square\)
The same coefficient matrix makes the residual uncorrelated with the controls. Indeed, \(\operatorname{Cov}(R_X,Z)=\Sigma_{XZ}-B\Sigma_{ZZ}=0\). This is the normal-equation property of linear projection. It does not, by itself, imply that \(R_X\) and \(Z\) are independent.
The Schur Complement and a Positivity Check
For a block matrix with invertible lower-right block, the Schur complement of \(\Sigma_{ZZ}\) in \(\Sigma\) is, by definition, \(\Sigma_{XX}-\Sigma_{XZ}\Sigma_{ZZ}^{-1}\Sigma_{ZX}\). The derivation above shows that this block-matrix expression is exactly the covariance of the residual vector.
A block factorization gives a second useful result. It shows why the Schur complement must be positive semidefinite when it comes from a covariance matrix.
To verify both claims, let \(S=\Sigma_{XX}-\Sigma_{XZ}\Sigma_{ZZ}^{-1}\Sigma_{ZX}\) and form the block matrix \(L=\begin{pmatrix}I_p&-\Sigma_{XZ}\Sigma_{ZZ}^{-1}\\0&I_q\end{pmatrix}\). Direct block multiplication gives:
The matrix \(\Sigma\) is a covariance matrix, so it is positive semidefinite: for every vector \(v\), \(v^{\mathsf T}\Sigma v\) is the variance of a linear combination of the components and is nonnegative. For any vector \(a\in\mathbb{R}^p\), apply positive semidefiniteness of \(L\Sigma L^{\mathsf T}\) to the vector \((a^{\mathsf T},0^{\mathsf T})^{\mathsf T}\). The resulting quadratic form is \(a^{\mathsf T}Sa\), so \(a^{\mathsf T}Sa\geq 0\) for every \(a\). Hence \(S\) is positive semidefinite.
For the determinant identity, \(L\) is block triangular with identity matrices on its diagonal, so \(\det(L)=1\). Therefore \(\det(L\Sigma L^{\mathsf T})=\det(\Sigma)\). The block-diagonal form has determinant \(\det(S)\det(\Sigma_{ZZ})\), proving the stated identity. \(\square\)
Worked Covariance Calculations
Worked Example: Two Targets and One Control
Suppose \(X=(X_1,X_2)^{\mathsf T}\) and \(Z\) are centered, with covariance blocks \(\Sigma_{XX}=\begin{pmatrix}5&1\\1&4\end{pmatrix}\), \(\Sigma_{XZ}=\begin{pmatrix}1\\2\end{pmatrix}\), and \(\Sigma_{ZZ}=2\). Find the residual covariance matrix.
The inverse control covariance is \(\Sigma_{ZZ}^{-1}=1/2\), and \(\Sigma_{ZX}=(1\quad 2)\). Thus the adjustment term is:
Subtracting this from \(\Sigma_{XX}\) gives:
After linear adjustment, the residual variances are \(9/2\) and \(2\), and the residual covariance is zero. The zero off-diagonal entry describes the residual association for this pair under this adjustment; it does not imply that the original targets were uncorrelated, since their original covariance was \(1\).
Worked Example: Residual Covariance for Two Scalar Targets
Let \(X\) and \(Y\) be centered targets and \(Z\) a centered control. Suppose \(\operatorname{Var}(X)=9\), \(\operatorname{Var}(Y)=4\), \(\operatorname{Cov}(X,Y)=3\), \(\operatorname{Cov}(X,Z)=2\), \(\operatorname{Cov}(Y,Z)=1\), and \(\operatorname{Var}(Z)=1\). Calculate the residual covariance matrix after adjusting both targets for \(Z\).
Here \(\Sigma_{XX}=\begin{pmatrix}9&3\\3&4\end{pmatrix}\) and \(\Sigma_{XZ}=\begin{pmatrix}2\\1\end{pmatrix}\). Because \(\Sigma_{ZZ}^{-1}=1\), the adjustment term is:
Therefore, \(\operatorname{Cov}(R_X,R_Y)=\begin{pmatrix}5&1\\1&3\end{pmatrix}\). In particular, the residual variances are \(5\) and \(3\), and the residual covariance is \(1\). If a residual correlation is desired, it is \(1/\sqrt{5\cdot3}=1/\sqrt{15}\). This calculation uses the same joint adjustment for both targets.
Worked Example: Two Controls and Two Targets
Suppose the covariance blocks are \(\Sigma_{XX}=\begin{pmatrix}4&1\\1&3\end{pmatrix}\), \(\Sigma_{XZ}=I_2\), and \(\Sigma_{ZZ}=\begin{pmatrix}2&1\\1&2\end{pmatrix}\). Find the residual covariance matrix.
The determinant of \(\Sigma_{ZZ}\) is \(2\cdot2-1\cdot1=3\), so it is positive definite, and \(\Sigma_{ZZ}^{-1}=\frac13\begin{pmatrix}2&-1\\-1&2\end{pmatrix}\). Since \(\Sigma_{XZ}=I_2\), the adjustment term is exactly this inverse:
Subtracting gives:
As a check, the diagonal entries are positive and the determinant is \((10/3)(7/3)-(4/3)^2=70/9-16/9=6>0\). Thus this calculated matrix is positive definite, consistent with the general positive-semidefiniteness result.
Interpretation and Common Pitfall
The term \(\Sigma_{XZ}\Sigma_{ZZ}^{-1}\Sigma_{ZX}\) is the covariance contribution removed by linear adjustment. It depends on the covariance among the controls through \(\Sigma_{ZZ}^{-1}\), as well as on the target-control covariances. For multiple targets, the adjustment changes both the diagonal residual variances and the off-diagonal residual covariances.
A common mistake is to call the Schur complement the conditional covariance matrix in every distribution. The formula always gives the covariance of the linear residuals under the stated second-moment conditions. It equals the conditional covariance \(\operatorname{Cov}(X\mid Z)\), which does not depend on the realized value of \(Z\), in the jointly Gaussian case. Outside that setting, conditional covariance can depend on \(Z\), and the conditional mean can be nonlinear; the residual covariance formula alone does not describe either feature.
Another practical warning is that the inverse in the formula is not available when \(\Sigma_{ZZ}\) is singular. This can happen when controls are redundant or linearly dependent. One should not silently use an ordinary inverse in that case: the projection can instead be formulated on the span of the controls, using a suitable generalized inverse, but that requires handling the rank-deficient case explicitly.
Check Your Understanding
Answer each question using the covariance-block setup above.
- For \(R_X=X-\Sigma_{XZ}\Sigma_{ZZ}^{-1}Z\), expand \(\operatorname{Cov}(R_X)\) and identify the three terms involving the controls.
- What assumptions ensure the displayed ordinary-inverse residual covariance formula is defined?
- Why does the block factorization imply that the residual covariance is positive semidefinite?
- In the first worked example, why can the residual covariance be zero even though the original target covariance is nonzero?
- When can residual covariance be interpreted as conditional covariance, and why is that interpretation not automatic in general?