Tutorials › Statistical Learning (Graduate) › Projection Approximation Error In Nested Spaces

Sieve and Structural Risk Minimization · Tutorial 223 of 989

Projection Approximation Error In Nested Spaces

Learn to express the best squared-loss risk in a linear space as a projection distance and calculate how that distance changes across nested spaces.

Intermediate 11 min read

What You'll Learn

  • Define squared-loss approximation error for a candidate linear space.
  • Relate prediction risk to distance from the conditional-mean regression function.
  • Derive the finite-dimensional projection formula using a Gram matrix.
  • Prove that approximation error cannot increase along nested spaces.
  • Calculate projection errors in continuous and discrete examples.
  • Distinguish approximation error from irreducible response noise.

Approximation Error as a Population Distance

A linear prediction space can be too small to represent the regression pattern in a population. Its approximation error measures the cost of that restriction before accounting for how accurately the space can be estimated from a sample. Under squared loss, this cost has a precise geometric form: it is the squared distance from the target regression function to the space.

Let \(X\) be a covariate, \(Y\) a response, and assume \(E[Y^2]<\infty\). Take \(X\) to have values in a measurable space for which the conditional mean has a measurable version \(m(x)=E[Y\mid X=x]\). A prediction function \(g\) assigns the value \(g(X)\) to a new covariate value. Its population squared risk is \(R(g)=E[(Y-g(X))^2]\). We measure distances between functions using the \(L_2(P_X)\) norm, \(\|h\|_{P_X}^2=E[h(X)^2]\); functions equal with probability one are identified.

Definition: For a linear prediction space \(\mathcal S\subset L_2(P_X)\), its squared-loss approximation error is $$ A(\mathcal S)=\inf_{g\in\mathcal S}\{R(g)-R(m)\}. $$ When \(\mathcal S\) is finite-dimensional, it is closed, the infimum is attained, and the minimizing function is the \(L_2(P_X)\) projection of \(m\) onto \(\mathcal S\).

The reference risk \(R(m)\) is the risk of predicting with the conditional mean. It need not be zero: random variation in \(Y\) given \(X\) can remain even when the regression function is known exactly. The first result separates that variation from the cost of using a different prediction function.

Theorem: For every \(g\in L_2(P_X)\), $$ R(g)=R(m)+\|g-m\|_{P_X}^2, \qquad R(m)=E[\operatorname{Var}(Y\mid X)]. $$ Consequently, for any finite-dimensional linear space \(\mathcal S\), $$ A(\mathcal S)=\inf_{g\in\mathcal S}\|g-m\|_{P_X}^2. $$

Proof. Write \(Y-g(X)=(Y-m(X))+(m(X)-g(X))\) and expand the square. The cross term has expectation zero because \(m(X)-g(X)\) is a function of \(X\) and \(E[Y-m(X)\mid X]=0\). More explicitly, conditional expectation gives $$ E[(Y-m(X))(m(X)-g(X))] =E[(m(X)-g(X))E[Y-m(X)\mid X]]=0. $$ Therefore \(R(g)=E[(Y-m(X))^2]+E[(m(X)-g(X))^2]\). The first term is \(E[\operatorname{Var}(Y\mid X)]\), which equals \(R(m)\), proving the identity. Subtracting \(R(m)\) and taking the infimum over \(\mathcal S\) gives the approximation-error formula. \(\square\)

Projection in a Finite-Dimensional Linear Space

Suppose \(\mathcal S\) is spanned by \(d\) linearly independent functions \(\phi_1,\ldots,\phi_d\) in \(L_2(P_X)\). A candidate in this space has the form \(g_\beta(x)=\sum_{j=1}^d\beta_j\phi_j(x)\). Define the Gram matrix \(G\) and vector \(c\) by \(G_{ij}=E[\phi_i(X)\phi_j(X)]\) and \(c_i=E[\phi_i(X)m(X)]\). Linear independence in \(L_2(P_X)\) makes \(G\) positive definite, so it is invertible.

Theorem: The unique closest function in \(\mathcal S\) to \(m\) has coefficient vector \(\beta^*=G^{-1}c\). Its approximation error is $$ A(\mathcal S)=E[m(X)^2]-c^\mathsf{T}G^{-1}c. $$

Proof. The residual \(r=m-g_{\beta^*}\) is orthogonal to every basis function: for each \(i\), $$ E[\phi_i(X)r(X)]=c_i-\sum_{j=1}^dG_{ij}\beta_j^*=c_i-(G\beta^*)_i=0. $$ For any other coefficient vector \(\beta\), \(g_\beta-g_{\beta^*}\) belongs to \(\mathcal S\), and hence is orthogonal to \(r\). Expanding the squared norm gives $$ \|m-g_\beta\|_{P_X}^2 =\|r-(g_\beta-g_{\beta^*})\|_{P_X}^2 =\|r\|_{P_X}^2+\|g_\beta-g_{\beta^*}\|_{P_X}^2. $$ Thus \(g_{\beta^*}\) minimizes the distance, uniquely up to equality in \(L_2(P_X)\). Also, \(E[m g_{\beta^*}]=(\beta^*)^\mathsf{T}c=c^\mathsf{T}G^{-1}c\), and \(E[g_{\beta^*}^2]=(\beta^*)^\mathsf{T}G\beta^*=c^\mathsf{T}G^{-1}c\). Expanding \(E[(m-g_{\beta^*})^2]\) therefore yields \(E[m^2]-c^\mathsf{T}G^{-1}c\), as claimed. \(\square\)

Worked Example: Projecting a Quadratic Regression Function

Let \(X\) be uniform on \([-1,1]\) and let \(m(x)=x^2\). Compare the spaces \(\mathcal S_0=\operatorname{span}\{1\}\), \(\mathcal S_1=\operatorname{span}\{1,x\}\), and \(\mathcal S_2=\operatorname{span}\{1,x,x^2\}\). For this distribution, \(E[X]=E[X^3]=0\), \(E[X^2]=1/3\), and \(E[X^4]=1/5\).

In \(\mathcal S_0\), the closest constant is \(E[m(X)]=1/3\). Its squared distance is $$ E[(X^2-1/3)^2]=E[X^4]-\frac{2}{3}E[X^2]+\frac{1}{9} =\frac{1}{5}-\frac{2}{9}+\frac{1}{9}=\frac{4}{45}. $$

For \(\mathcal S_1\), use the basis \((1,x)\). Its Gram matrix is diagonal, \(G=\begin{pmatrix}1&0\\0&1/3\end{pmatrix}\), while \(c=(E[X^2],E[X^3])^\mathsf{T}=(1/3,0)^\mathsf{T}\). Thus \(G^{-1}c=(1/3,0)^\mathsf{T}\). The projection is still the constant \(1/3\), so \(A(\mathcal S_1)=4/45\). Adding the linear function does not help here because the quadratic target is orthogonal to \(x\) under this symmetric distribution.

Since \(m(x)=x^2\) belongs to \(\mathcal S_2\), its projection there is itself and \(A(\mathcal S_2)=0\). The calculation shows that increasing dimension need not reduce error at every step, but including the target function makes the error zero.

Worked Example: A Nonorthogonal Basis on the Unit Interval

Let \(X\) be uniform on \([0,1]\), \(m(x)=x^2\), and \(\mathcal S=\operatorname{span}\{1,x\}\). The basis functions are not orthogonal: \(E[X]=1/2\). To find the projection \(a+bx\), require its residual to be orthogonal to both basis functions: $$ a+\frac{b}{2}=E[X^2]=\frac{1}{3}, \qquad \frac{a}{2}+\frac{b}{3}=E[X^3]=\frac{1}{4}. $$

Subtract half the first equation from the second. This gives \(b(1/3-1/4)=1/4-1/6\), so \(b=1\), and then \(a=1/3-1/2=-1/6\). The projection is \(x-1/6\). Its squared residual distance can be calculated from the projection formula: \(E[m^2]=E[X^4]=1/5\), and $$ E[m(X)(X-1/6)]=E[X^3]-\frac{1}{6}E[X^2] =\frac{1}{4}-\frac{1}{18}=\frac{7}{36}. $$

Orthogonality implies the squared norm of the projection is also \(7/36\). Therefore \(A(\mathcal S)=1/5-7/36=1/180\). The nonzero error confirms that a linear function cannot reproduce \(x^2\) exactly on this interval.

Nested Spaces and Decreasing Approximation Error

A sieve is often organized as a sequence of nested spaces, \(\mathcal S_1\subseteq\mathcal S_2\subseteq\cdots\). The best approximation in a larger space can always use a function from the smaller space, so enlarging the available set cannot worsen the best population approximation.

Result: If \(\mathcal S_k\subseteq\mathcal S_{k+1}\), then $$ 0\leq A(\mathcal S_{k+1})\leq A(\mathcal S_k). $$ For finite-dimensional spaces, write \(g_k^*\) for the projection of \(m\) onto \(\mathcal S_k\). Then $$ A(\mathcal S_k)=A(\mathcal S_{k+1})+\|g_{k+1}^*-g_k^*\|_{P_X}^2. $$

Proof. Each approximation error is an infimum of squared norms, so it is nonnegative. Since \(\mathcal S_k\) is contained in \(\mathcal S_{k+1}\), minimizing \(\|m-g\|_{P_X}^2\) over \(\mathcal S_{k+1}\) cannot give a larger value than minimizing over \(\mathcal S_k\). For the identity, the projection residual \(m-g_{k+1}^*\) is orthogonal to every element of \(\mathcal S_{k+1}\), including \(g_{k+1}^*-g_k^*\). Consequently, $$ \|m-g_k^*\|_{P_X}^2 =\|(m-g_{k+1}^*)+(g_{k+1}^*-g_k^*)\|_{P_X}^2 =\|m-g_{k+1}^*\|_{P_X}^2+\|g_{k+1}^*-g_k^*\|_{P_X}^2. $$ The two squared distances are the stated approximation errors. \(\square\)

Worked Example: Approximation Error Versus Response Noise

Let \(X\) take the values \(-1\) and \(1\) with probability \(1/2\) each, and let \(Y=X+\varepsilon\), where \(E[\varepsilon\mid X]=0\) and \(\operatorname{Var}(\varepsilon\mid X)=4\). Then \(m(x)=x\) and \(R(m)=4\). Compare \(\mathcal S_0=\operatorname{span}\{1\}\) with \(\mathcal S_1=\operatorname{span}\{1,x\}\).

The projection of \(m\) onto constants is \(E[X]=0\). Its squared distance is \(E[X^2]=1\), so \(A(\mathcal S_0)=1\) and the smallest risk in that space is \(R(m)+A(\mathcal S_0)=4+1=5\). Since \(m(x)=x\) belongs to \(\mathcal S_1\), \(A(\mathcal S_1)=0\), and the smallest risk there is \(4\). Enlarging the space removes the approximation cost, but not the conditional response variance.

Interpretation and a Common Pitfall

Approximation error describes a population limitation: even with the best possible choice of coefficients in a given space, the space may not contain a close enough representation of \(m\). It is distinct from error caused by estimating coefficients using finite data. The nested-space result concerns only these best population approximations; it does not say that fitting a larger model to a particular sample will improve its performance on new data.

  • Common mistake: treating total risk as approximation error. The reasoning “the risk is positive, so the model has approximation error” is wrong. A model containing \(m\) has zero approximation error even when \(R(m)>0\), as the noise example shows. The correction is to subtract \(R(m)\): the squared-loss excess risk is exactly the squared \(L_2(P_X)\) distance from \(g\) to \(m\).
  • Common mistake: assuming each added basis function must reduce error strictly. Nesting guarantees only that error does not increase. An added direction may be orthogonal to the current residual, as \(x\) was in the symmetric quadratic example, giving no reduction.
Key takeaway: Under squared loss, the best achievable risk in a finite-dimensional linear space is \(R(m)\) plus the squared distance from \(m\) to that space. Nested spaces make this approximation component non-increasing, while irreducible response variation remains separate.

Check Your Understanding

Use the projection-distance interpretation to answer the following.

  1. Why can a predictor have positive risk but zero approximation error in its model space?
  2. For a finite-dimensional basis, what do the entries of the Gram matrix represent, and why is it invertible when the basis functions are linearly independent in \(L_2(P_X)\)?
  3. If \(\mathcal S_k\subseteq\mathcal S_{k+1}\), can the approximation error increase? Can it stay unchanged? Explain.
  4. In the uniform \([-1,1]\) example, why does adding \(x\) to the constant space not improve the approximation to \(x^2\)?
  5. What additional condition on a space would make its approximation error exactly zero?
Clinical Biostats