Why the Regression Residual Matters
In Gaussian regression, the conditional mean gives the best predictor of a response from the observed predictors. Subtracting that mean from the response leaves a residual. The important Gaussian fact is stronger than saying this residual has mean zero: it is independent of the predictors. That fact lets us represent the response as a predictable linear part plus fresh Gaussian variation, and it gives a useful factorization of the joint law.
We consider a response vector \(Y\in\mathbb{R}^q\) and a predictor vector \(X\in\mathbb{R}^p\). A scalar response is the special case \(q=1\). Assume \((Y,X)\) is jointly Gaussian, with means \(\mu_Y\) and \(\mu_X\), and covariance blocks
We assume \(\Sigma_{XX}\) is positive definite, so it is invertible. The full joint covariance need only be positive semidefinite; the residual covariance below can be singular.
For a jointly Gaussian pair with \(\Sigma_{XX}\) positive definite, the conditional distribution is
Here \(N_q(a,V)\) denotes a \(q\)-dimensional Gaussian distribution with mean vector \(a\) and covariance matrix \(V\), including the possibility that \(V\) is singular. The formula says that, once \(X=x\) is fixed, the conditional mean is exactly \(m(x)\), while the conditional covariance is the same matrix \(S\) for every \(x\).
Independence of the Residual and Predictors
The proof uses the conditional distribution directly. It is important to do this rather than infer independence merely from a covariance calculation; independence does not follow from zero covariance for arbitrary distributions.
For fixed \(X=x\), subtract the conditional mean \(m(x)\) from the conditional Gaussian response.
The resulting conditional distribution is \(N_q(0,S)\), which does not depend on \(x\).
A conditional law that is constant in \(X\) yields the defining product-probability identity for independence.
Proof. Because \(m(x)\) is a deterministic function of \(x\), the conditional distribution of \(\varepsilon\) given \(X=x\) is the distribution of \(Y-m(x)\) given \(X=x\). By the conditional Gaussian formula,
This holds as a conditional distribution for \(X\)-almost every \(x\); it also describes the usual Gaussian conditional kernel for every \(x\). In particular, for every Borel set \(A\subseteq\mathbb{R}^q\), \(P(\varepsilon\in A\mid X)=\nu(A)\) almost surely, where \(\nu\) is the fixed probability law \(N_q(0,S)\). For any Borel set \(C\subseteq\mathbb{R}^p\), the defining property of conditional expectation gives
The last equality follows because averaging the constant conditional probability gives \(P(\varepsilon\in A)=\nu(A)\). The product identity for all such Borel sets proves independence, and the conditional law also gives \(\varepsilon\sim N_q(0,S)\). \(\square\)
Factoring the Joint Law
The theorem gives a product representation of the joint law without requiring a density. Let \(P_X\) be the law of \(X\), and let \(\nu=N_q(0,S)\). Since \(X\) and \(\varepsilon\) are independent, their joint law is the product measure \(P_X\otimes\nu\). The pair \((X,Y)\) is obtained by applying the map \((x,e)\mapsto (x,m(x)+e)\) to this product law. Equivalently, for Borel sets \(C\subseteq\mathbb{R}^p\) and \(D\subseteq\mathbb{R}^q\),
where \(D-m(x)=\{y-m(x):y\in D\}\). This is the joint-law factorization into the predictor distribution and an independent residual distribution, followed by the regression map.
If \(S\) is positive definite, both \(X\) and the residual have densities. The change of variables from \((x,e)\) to \((x,y)=(x,m(x)+e)\) has Jacobian determinant \(1\): its derivative is block triangular with identity matrices on the diagonal. Thus the joint density factors as
This is also the familiar conditional-density factorization \(f_{X,Y}(x,y)=f_X(x)f_{Y\mid X}(y\mid x)\), with the conditional density written as a fixed residual density shifted by \(m(x)\). If \(S\) is singular, a Lebesgue density for the residual may not exist, but the product-measure statement and the probability factorization remain valid.
Worked Example: A Scalar Response and Predictor
Suppose \(X\) and \(Y\) are jointly Gaussian with \(E[X]=2\), \(E[Y]=1\), \(\operatorname{Var}(X)=4\), \(\operatorname{Var}(Y)=9\), and \(\operatorname{Cov}(Y,X)=3\). Find the conditional-mean predictor and residual distribution, and verify the factorization.
The regression coefficient is the covariance divided by the predictor variance:
Therefore the conditional-mean predictor and residual are
The residual variance is the conditional variance:
Thus \(Y\mid X=x\sim N(1+\tfrac34(x-2),27/4)\), and the theorem gives \(\varepsilon\sim N(0,27/4)\) independently of \(X\). The specified covariance matrix is valid and nonsingular: its determinant is \(4(9)-3^2=27>0\), and its diagonal entries are positive. Since both conditional variances are positive, the joint density factors as \(f_{X,Y}(x,y)=f_X(x)f_{\varepsilon}(y-1-\tfrac34(x-2))\).
Worked Example: Two Predictors and a Scalar Response
Let \(X=(X_1,X_2)^{\mathsf T}\) have mean zero and covariance \(\Sigma_{XX}=\begin{pmatrix}4&1\\1&2\end{pmatrix}\). Suppose \(Y\) has mean zero, variance \(5\), and covariance row \(\Sigma_{YX}=(2,1)\). Find the regression predictor and residual variance.
The determinant of \(\Sigma_{XX}\) is \(4(2)-1=7>0\), and its leading diagonal entry is positive, so \(\Sigma_{XX}\) is positive definite. Its inverse is
Multiplying the covariance row by this inverse gives the regression coefficient row:
So \(m(X)=\tfrac37X_1+\tfrac27X_2\). For the residual variance, multiply this coefficient row by the covariance column:
The residual is therefore \(N(0,27/7)\) and independent of the pair \((X_1,X_2)\). The covariance specification is consistent: \(\Sigma_{XX}\) is positive definite and its Schur complement \(27/7\) is positive, so the joint covariance is positive definite. In particular, the response law conditional on both predictors has a constant residual variance, not a variance that changes with their observed values.
Worked Example: A Vector Response and a Scalar Predictor
Let \(X\) have mean zero and variance \(2\). Let \(Y=(Y_1,Y_2)^{\mathsf T}\) have mean \((1,-1)^{\mathsf T}\), covariance \(\Sigma_{YY}=\begin{pmatrix}3&1\\1&6\end{pmatrix}\), and covariance \(\Sigma_{YX}=(1,2)^{\mathsf T}\). Find the residual covariance and express the joint law through independent components.
The regression coefficient vector is \(\Sigma_{YX}\operatorname{Var}(X)^{-1}=(1/2,1)^{\mathsf T}\). Hence
The covariance reduction is
Thus \(\varepsilon=Y-m(X)\sim N_2(0,S)\) independently of \(X\), and \(Y=m(X)+\varepsilon\). The residual components also have a product Gaussian law because \(S\) is diagonal; explicitly, they have variances \(5/2\) and \(4\). The joint covariance is positive definite: \(\Sigma_{YY}\) is positive definite because its determinant is \(17\) and its first diagonal entry is positive, and the Schur complement \(S\) is positive definite. Since \(\operatorname{Var}(X)=2\), the full covariance is positive definite as well. The joint law can therefore be factored by first drawing \(X\), then drawing an independent residual vector with covariance \(S\), and finally setting \(Y=m(X)+\varepsilon\).
What the Result Does—and Does Not—Say
The result matters because it gives an exact probability model, not just a convenient prediction formula. Conditional on the predictors, all remaining randomness in \(Y\) is represented by a residual whose distribution does not change with the predictor value. Conversely, the response is recovered by adding that independent residual to its conditional mean. This representation is useful for deriving joint probabilities, simulating Gaussian regression models, and separating systematic variation from residual variation.
The scope of the conclusion is precise. It applies to a jointly Gaussian population vector with an invertible predictor covariance matrix. The independence proved here is between the population residual \(Y-m(X)\) and the random predictor vector \(X\). It is not, by itself, a claim that residuals computed after fitting a regression to a finite sample are independent of the observed design, nor that the result holds for non-Gaussian variables.
Common Pitfall
- Wrong reasoning: “The residual has zero covariance with \(X\), so it must be independent of \(X\).” Zero covariance alone does not establish independence in a general distribution.
- Correction: Use the joint Gaussian assumption and the conditional distribution. Subtracting the conditional mean makes the conditional law of the residual \(N_q(0,S)\), the same for every predictor value. The resulting constant conditional law proves independence by the product-probability identity.
- Wrong interpretation: “The residual is independent because it is defined as an error.” The definition alone does not confer independence; the Gaussian model and conditional-mean construction are essential.
Check Your Understanding
Use the assumptions and formulas in this tutorial to answer the following.
- Why is the positive definiteness of \(\Sigma_{XX}\) relevant to defining the regression coefficient matrix?
- For scalar \(Y\), write the residual variance in terms of \(\operatorname{Var}(Y)\), \(\operatorname{Cov}(Y,X)\), and \(\operatorname{Var}(X)\).
- Which feature of the conditional residual distribution is used to prove independence from \(X\)?
- Does the product-law conclusion require \(S\) to be positive definite? Explain the distinction between a probability-law factorization and a density factorization.
- Why would zero covariance between a residual and a predictor not, on its own, prove independence without the Gaussian assumption?