Tutorials › Statistical Learning (Graduate) › Misspecified Linear Regression and the Projection Target

ERM Consistency and Rates · Tutorial 218 of 989

Misspecified Linear Regression and the Projection Target

Learn how to identify the population linear projection, interpret its residual orthogonality correctly, and establish consistency of empirical least squares.

Intermediate 10 min read

What You'll Learn

  • Define the population least-squares projection for a possibly misspecified linear model
  • Derive its normal equations and excess-risk identity
  • Distinguish residual orthogonality from zero covariance when there is no intercept
  • Calculate projection coefficients in explicit examples
  • Prove empirical least squares converges under finite second moments and nonsingularity

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\).

Definition: The population least-squares projection coefficient is any vector \(b^*\) minimizing \(R(b)=E[(Y-b^\mathsf{T}Z)^2]\) over \(b\in\mathbb{R}^p\). If \(Z\) includes a coordinate equal to 1, the model includes an intercept. The model is misspecified when the conditional mean \(E[Y\mid Z]\) is not in the set of linear predictors \(\{b^\mathsf{T}Z:b\in\mathbb{R}^p\}\).

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.

Theorem: If \(E[Y^2]<\infty\), \(E[\|Z\|^2]<\infty\), and \(Q=E[ZZ^\mathsf{T}]\) is positive definite, then the unique population least-squares projection is \(b^*=Q^{-1}g\), where \(g=E[ZY]\). Its residual \(e=Y-(b^*)^\mathsf{T}Z\) satisfies \(E[Ze]=0\), and for every \(b\), \(R(b)-R(b^*)=(b-b^*)^\mathsf{T}Q(b-b^*)\).

Proof. Expand the risk:

$$ R(b)=E[Y^2]-2b^\mathsf{T}E[ZY]+b^\mathsf{T}E[ZZ^\mathsf{T}]b =E[Y^2]-2b^\mathsf{T}g+b^\mathsf{T}Qb. $$

Because \(Q\) is positive definite, \(R(b)\) is a strictly convex quadratic function. Completing the square around \(Q^{-1}g\) gives

$$ R(b)=E[Y^2]-g^\mathsf{T}Q^{-1}g +(b-Q^{-1}g)^\mathsf{T}Q(b-Q^{-1}g). $$

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,

$$ E[Ze]=E[ZY]-E[ZZ^\mathsf{T}]b^*=g-Qb^*=0. $$

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

$$ Q= \begin{pmatrix} 1&0\\ 0&1/3 \end{pmatrix}, \qquad g= \begin{pmatrix} E[Y]\\ E[XY] \end{pmatrix} = \begin{pmatrix} 1/3\\ 0 \end{pmatrix}. $$

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,

$$ \operatorname{Cov}(Z,e)=E[Ze]-E[Z]E[e] =0-(1.5)(0.1)=-0.15. $$

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\).

Theorem: Suppose the observations are independent and identically distributed, \(E[Y^2]<\infty\), \(E[\|Z\|^2]<\infty\), and \(Q=E[ZZ^\mathsf{T}]\) is positive definite. Then, with probability one, \(Q_n\) is invertible for all sufficiently large \(n\), and the unique empirical least-squares coefficient satisfies \(\hat b_n\xrightarrow{a.s.}b^*=Q^{-1}E[ZY]\).

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

$$ \hat b_n=Q_n^{-1}g_n \xrightarrow{a.s.}Q^{-1}g=b^*. $$

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

$$ \hat b_{1,6} =\frac{13/3-(4/3)(7/3)}{7/3-(4/3)^2} =\frac{11/9}{5/9} =\frac{11}{5}, \qquad \hat b_{0,6} =\frac{7}{3}-\frac{11}{5}\frac{4}{3} =-\frac{3}{5}. $$

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.
Key takeaway: The population least-squares coefficient is \(Q^{-1}E[ZY]\) when the feature second-moment matrix is positive definite. Its residual is orthogonal to the included features in the \(L^2\) inner product; an intercept additionally makes the residual mean zero. Under finite second moments, empirical least squares converges almost surely to this projection target.

Check Your Understanding

Use the definitions and conditions in this tutorial to answer the following.

  1. What population moments determine the least-squares projection coefficient, and what condition makes that coefficient unique?
  2. Why does \(E[Ze]=0\) not, by itself, imply \(\operatorname{Cov}(Z_j,e)=0\)?
  3. What additional conclusion follows from the normal equations when the feature vector includes a constant coordinate equal to 1?
  4. 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\)?
  5. Which moment assumptions ensure that the strong law applies to the empirical feature matrix and feature-response vector?
Clinical Biostats