Why a Linear Model Has a Target Even When It Is Wrong
A linear regression model is often used even when the conditional mean of the response is not exactly linear in the predictors. In that setting, there may be no coefficient vector that describes the conditional mean perfectly. There is still a well-defined best linear predictor under squared-error risk: the population least-squares projection. It depends on the distribution of the predictors and response, and it is the target that empirical least squares estimates when the model is held fixed.
The projection is not automatically a causal effect, nor does its existence imply that the linear model is correctly specified. Its meaning is narrower: among the predictors in the chosen linear span, it minimizes expected squared prediction error. We derive that target, examine the precise meaning of its residual equations, and show why empirical least squares converges to it under standard moment and nonsingularity conditions.
Population Projection and Its Normal Equations
Let \((Y,Z)\) be a random response and feature vector, where \(Y\) is real-valued and \(Z\in\mathbb{R}^p\). A coefficient vector \(b\in\mathbb{R}^p\) predicts \(Y\) by \(b^\mathsf{T}Z\). Assume \(E[Y^2]<\infty\) and \(E[\|Z\|^2]<\infty\), so the squared-error risk is finite for every fixed \(b\).
Define the feature second-moment matrix \(Q=E[ZZ^\mathsf{T}]\) and the feature-response moment vector \(g=E[ZY]\). The stated moment assumptions make all entries finite. If \(Q\) is positive definite, it is invertible, and the projection is unique.
Proof. Expand the risk:
Because \(Q\) is positive definite, \(R(b)\) is a strictly convex quadratic function. Completing the square around \(Q^{-1}g\) gives
The final term is nonnegative and equals zero only at \(b=Q^{-1}g\). Thus the unique minimizer is \(b^*=Q^{-1}g\), and subtracting the minimum risk gives the stated excess-risk identity. Finally,
This proves the theorem. \(\square\)
The equation \(E[Ze]=0\) means that the residual is orthogonal to each included feature in the \(L^2\) inner product \(E[UV]\). Without an intercept, this does not in general say that the residual has mean zero or that it is uncorrelated with each feature. If \(Z\) includes a constant coordinate equal to 1, the corresponding equation gives \(E[e]=0\). In that case, for every other feature \(Z_j\), \(\operatorname{Cov}(Z_j,e)=E[Z_je]-E[Z_j]E[e]=0\).
Worked Example: Projecting a Quadratic Mean onto a Line
Let \(X\) be uniform on \([-1,1]\), let \(Y=X^2+\varepsilon\), and use the feature vector \(Z=(1,X)^\mathsf{T}\). Suppose \(E[\varepsilon\mid X]=0\) and \(E[\varepsilon^2]<\infty\). The conditional mean is \(X^2\), which is not linear in \(1\) and \(X\), so this is a misspecified linear model.
For a uniform random variable on \([-1,1]\), \(E[X]=E[X^3]=0\), \(E[X^2]=1/3\), and \(E[X^4]=1/5\). Conditional mean zero implies \(E[\varepsilon]=E[X\varepsilon]=0\). Therefore
Thus \(b^*=Q^{-1}g=(1/3,0)^\mathsf{T}\), and the best linear predictor is the constant \(1/3\). Its residual is \(e=X^2-1/3+\varepsilon\). Directly, \(E[e]=1/3-1/3+0=0\), and \(E[Xe]=E[X^3]-E[X]/3+E[X\varepsilon]=0\), as required.
The minimum risk is also explicit. The cross term between \(X^2-1/3\) and \(\varepsilon\) has expectation zero because \(E[\varepsilon\mid X]=0\). Hence \(R(b^*)=E[(X^2-1/3)^2]+E[\varepsilon^2]\), where \(E[(X^2-1/3)^2]=1/5-2/9+1/9=4/45\). Thus \(R(b^*)=4/45+E[\varepsilon^2]\). The projection captures the best linear approximation, but it does not remove the quadratic component.
Residual Orthogonality Is Not Always Zero Covariance
The distinction between an inner-product equation and a covariance equation matters especially when a regression has no intercept. The normal equations impose \(E[Z_je]=0\) for each included feature, not necessarily \(\operatorname{Cov}(Z_j,e)=0\). The next calculation shows why those statements are different.
Worked Example: A Projection Through the Origin
Let \(Z\) equal 1 or 2 with probability \(1/2\) each, let \(Y=1\), and fit the predictor \(bZ\) without an intercept. Here \(Q=E[Z^2]=(1+4)/2=5/2\) and \(g=E[ZY]=(1+2)/2=3/2\). The projection coefficient is \(b^*=g/Q=3/5=0.6\).
The residual is \(e=1-0.6Z\). It equals \(0.4\) when \(Z=1\) and \(-0.2\) when \(Z=2\). The normal equation holds: \(E[Ze]=\{1(0.4)+2(-0.2)\}/2=0\). But \(E[e]=(0.4-0.2)/2=0.1\), while \(E[Z]=1.5\). Consequently,
So the residual is orthogonal to the feature in the \(L^2\) inner product but is not uncorrelated with it. The minimum risk is \(E[e^2]=(0.16+0.04)/2=0.1\). If an intercept were included, the constant response \(Y=1\) could instead be fitted exactly with intercept 1 and slope 0.
Empirical Least Squares Converges to the Projection
Now let \((Y_i,Z_i)\), \(i=1,\ldots,n\), be independent and identically distributed observations from the same distribution as \((Y,Z)\). Empirical least squares minimizes \(P_n(Y-b^\mathsf{T}Z)^2\), where \(P_n\) denotes the average over the \(n\) observations. Define \(Q_n=n^{-1}\sum_{i=1}^n Z_iZ_i^\mathsf{T}\) and \(g_n=n^{-1}\sum_{i=1}^n Z_iY_i\). When \(Q_n\) is invertible, the empirical minimizer is \(\hat b_n=Q_n^{-1}g_n\).
Proof. Each entry of \(Z_iZ_i^\mathsf{T}\) is integrable: for coordinates \(j,k\), Cauchy–Schwarz gives \(E[|Z_jZ_k|]\leq\{E[Z_j^2]E[Z_k^2]\}^{1/2}<\infty\). Similarly, \(E[|Z_jY|]\leq\{E[Z_j^2]E[Y^2]\}^{1/2}<\infty\). The strong law of large numbers applied to each of the finitely many entries therefore yields \(Q_n\xrightarrow{a.s.}Q\) and \(g_n\xrightarrow{a.s.}g\).
The determinant is a continuous function of the matrix entries, so \(\det(Q_n)\xrightarrow{a.s.}\det(Q)\). Positive definiteness of \(Q\) implies \(\det(Q)>0\); therefore, with probability one, \(\det(Q_n)\neq 0\) for all sufficiently large \(n\). For those \(n\), the empirical minimizer is unique and equals \(Q_n^{-1}g_n\). Matrix inversion is continuous at every invertible matrix, so \(Q_n^{-1}\xrightarrow{a.s.}Q^{-1}\). Combining these convergences gives
This proves the theorem. \(\square\)
The finite second-moment assumptions serve two roles: they ensure the population squared-error risk is finite and make the entries used in the strong-law argument integrable. Positive definiteness is an identifiability condition for the chosen features: no nonzero linear combination of them is zero almost surely. If it fails, the coefficient vector need not be unique, and the displayed inverse formula is unavailable.
Worked Example: A Finite Sample and Its Projection Limit
Let \(X\) take values \(0,1,2\), each with probability \(1/3\), let \(Y=X^2\), and fit an intercept and slope using \(Z=(1,X)^\mathsf{T}\). The population moments are \(E[X]=1\), \(E[Y]=E[X^2]=5/3\), \(E[XY]=E[X^3]=3\), and \(\operatorname{Var}(X)=5/3-1=2/3\). The population slope is \((E[XY]-E[X]E[Y])/\operatorname{Var}(X)=(3-5/3)/(2/3)=2\), and the intercept is \(E[Y]-2E[X]=5/3-2=-1/3\). Thus \(b^*=(-1/3,2)^\mathsf{T}\).
Consider a sample of six observations with \(X\)-values \(0,1,1,2,2,2\), and responses \(Y=X^2\). Its empirical means are \(\bar X=8/6=4/3\), \(\bar Y=14/6=7/3\), \(\overline{X^2}=14/6=7/3\), and \(\overline{XY}=26/6=13/3\). The empirical slope and intercept are therefore
This sample estimate, \((-3/5,11/5)^\mathsf{T}\), differs from the population target \((-1/3,2)^\mathsf{T}\). Its counts are not equal across the three support points. In an independent and identically distributed sample, the empirical proportions at those points converge almost surely to \(1/3\); the theorem then explains why the empirical coefficients converge to the population projection.
Interpretation and a Common Pitfall
Under misspecification, the projection target is distribution-dependent. If the predictor distribution changes, the best linear approximation can change even when the conditional mean function stays the same. The projection is consequently a precise prediction target for a specified population and feature set, not a claim that the linear model is the true conditional mean.
- Pitfall: saying normal equations make the residual uncorrelated with every feature. That statement is too strong without an intercept. The equations give \(E[Z_je]=0\), an \(L^2\) orthogonality condition. To conclude zero covariance, one also needs \(E[e]=0\); an included constant feature supplies that equation.
- Pitfall: treating nonsingularity as a technical detail. If features are linearly dependent in the population, different coefficient vectors can give the same prediction almost surely. The projection prediction may remain meaningful, but a unique coefficient target and the inverse formula require nonsingularity.
- Pitfall: calling the empirical coefficient the population target in a finite sample. The sample coefficients generally differ from \(b^*\). The consistency theorem is an asymptotic statement under independent, identically distributed sampling and the stated moment and nonsingularity assumptions.
Check Your Understanding
Use the definitions and conditions in this tutorial to answer the following.
- What population moments determine the least-squares projection coefficient, and what condition makes that coefficient unique?
- Why does \(E[Ze]=0\) not, by itself, imply \(\operatorname{Cov}(Z_j,e)=0\)?
- What additional conclusion follows from the normal equations when the feature vector includes a constant coordinate equal to 1?
- In the quadratic example with \(X\) uniform on \([-1,1]\), why is the best linear predictor constant even though the conditional mean varies with \(X\)?
- Which moment assumptions ensure that the strong law applies to the empirical feature matrix and feature-response vector?