Tutorials › Statistical Learning (Graduate) › Exact Risk Change When Adding a Predictor

Ensemble Risk and Diversity · Tutorial 885 of 989

Exact Risk Change When Adding a Predictor

Use the current ensemble error and its covariance with an update to determine exactly when a specified predictor weight reduces squared-error risk.

Advanced 10 min read

What You'll Learn

  • Express an ensemble update as a change to its prediction and derive the exact risk difference.
  • Identify the covariance and second-moment terms that determine whether a fixed weight helps.
  • Distinguish an additive predictor from a convex blend that rescales existing weights.
  • Derive the best unconstrained scalar weight for a specified update direction.
  • Recognize why positive covariance alone does not guarantee improvement at every weight.

Risk Change From a Prediction Update

A predictor can be individually useful and still raise an ensemble’s risk when assigned an unsuitable weight. The relevant question is not just whether the new predictor is accurate, but how its contribution lines up with the ensemble’s current errors and how large that contribution is. Squared-error risk makes this comparison exact: the change is a quadratic function of the weight.

Let \((X,Y)\) have a fixed evaluation distribution, and suppose the predictions being compared have finite second moments. Write \(f(X)\) for the current ensemble prediction and \(h(X)\) for a proposed change in prediction. Giving that change weight \(\alpha\) produces \(f_\alpha(X)=f(X)+\alpha h(X)\). This notation covers directly adding a predictor and, with a different choice of \(h\), blending in a replacement predictor.

Definition: The squared-error risk of a prediction rule \(f\) is \(R(f)=E[(Y-f(X))^2]\). Its current error is \(e=Y-f(X)\). For the update \(f_\alpha=f+\alpha h\), the update direction is \(h\), and its weighted contribution to the prediction is \(\alpha h\).

All expectations and covariances below are under the same evaluation distribution. That common distribution matters: comparing risks calculated under different distributions would not isolate the effect of changing the predictor.

The Exact Risk-Change Identity

After the update, the error is \(e_\alpha=Y-f_\alpha(X)=e-\alpha h\). Squaring this error and taking expectations gives the risk difference directly.

Theorem: If \(E[e^2]\) and \(E[h^2]\) are finite, then for every real weight \(\alpha\), $$ R(f_\alpha)-R(f) =\alpha^2 E[h^2]-2\alpha E[eh]. $$ Equivalently, $$ R(f_\alpha)-R(f) =\alpha^2 E[h^2]-2\alpha\{\operatorname{Cov}(e,h)+E[e]E[h]\}. $$

Proof. Since \(e_\alpha=e-\alpha h\), expansion gives \(e_\alpha^2=e^2-2\alpha eh+\alpha^2h^2\). Each term has a finite expectation: \(e\) and \(h\) have finite second moments, so \(E[|eh|]\leq \sqrt{E[e^2]E[h^2]}<\infty\) by Cauchy–Schwarz. Taking expectations and subtracting \(R(f)=E[e^2]\) proves the first identity. The second follows from \(E[eh]=\operatorname{Cov}(e,h)+E[e]E[h]\). \(\square\)

The identity separates the contribution’s size, \(E[h^2]\), from its alignment with current error, \(E[eh]\). If current error is positive where \(h\) is positive, for example, adding a positive amount of \(h\) pushes the prediction in the direction that reduces that error. If \(h\) tends to have the opposite sign, the update can instead move predictions further from the target.

Risk-reduction condition: For a specified nonzero weight \(\alpha\), risk decreases exactly when $$ \alpha\{\alpha E[h^2]-2E[eh]\}<0. $$ In particular, if \(\alpha>0\) and \(E[h^2]>0\), risk decreases exactly when \(2E[eh]>\alpha E[h^2]\). If \(E[h^2]=0\), then \(h=0\) almost surely and the update changes no predictions.

When both \(e\) and \(h\) have mean zero, the alignment term simplifies to \(\operatorname{Cov}(e,h)\), and \(E[h^2]=\operatorname{Var}(h)\). But covariance by itself is not generally enough: when either mean is nonzero, the product of means also contributes to \(E[eh]\), and the update’s second moment includes any nonzero mean of \(h\).

Worked Example: An Additive Predictor at a Fixed Weight

Suppose a candidate prediction \(h\) is added without changing the current ensemble’s weights. Across four equally likely evaluation cases, the current errors \(e\) and candidate predictions \(h\) are:

Case\(e\)\(h\)\(eh\)\(h^2\)
12121
22000
3-2-121
4-2000

The current risk is \(E[e^2]=(4+4+4+4)/4=4\). The table gives \(E[eh]=(2+0+2+0)/4=1\) and \(E[h^2]=(1+0+1+0)/4=0.5\). At weight \(\alpha=0.5\), the exact risk change is $$ R(f_{0.5})-R(f)=(0.5)^2(0.5)-2(0.5)(1)=0.125-1=-0.875. $$ Thus the updated risk is \(4-0.875=3.125\), so this specified addition improves on the current risk. The condition also checks directly: \(2E[eh]=2\) exceeds \(\alpha E[h^2]=0.25\).

Convex Blending and Candidate Error Covariance

A common alternative is to blend the current ensemble with a candidate predictor \(g(X)\), assigning the candidate weight \(\alpha\) and scaling the current ensemble weight to \(1-\alpha\). This is not the same operation as leaving the old weights unchanged and appending a term. For the blend \(f_\alpha=(1-\alpha)f+\alpha g\), the update direction in the identity is \(h=g-f\).

Write \(u=Y-g(X)\) for the candidate’s error. Then \(h=e-u\), and the blended error is \((1-\alpha)e+\alpha u\). Substitution gives an exact formula involving both prediction errors:

Blending identity: If \(E[e^2]\) and \(E[u^2]\) are finite, then $$ R(f_\alpha)-R(f) =-2\alpha\{E[e^2]-E[eu]\}+\alpha^2E[(e-u)^2]. $$ If \(e\) and \(u\) both have mean zero, this becomes $$ R(f_\alpha)-R(f) =2\alpha\{\operatorname{Cov}(e,u)-\operatorname{Var}(e)\} +\alpha^2\{\operatorname{Var}(e)+\operatorname{Var}(u)-2\operatorname{Cov}(e,u)\}. $$

The second form shows how covariance between the current and candidate errors enters the decision. For a positive blend weight and \(E[(e-u)^2]>0\), blending reduces risk exactly when $$ 2\{E[e^2]-E[eu]\}>\alpha E[(e-u)^2]. $$ Under the stated zero-mean conditions, \(E[eu]=\operatorname{Cov}(e,u)\). Without those conditions, replace the covariance by \(\operatorname{Cov}(e,u)+E[e]E[u]\); covariance alone does not give the exact criterion.

Worked Example: Checking a Convex Blend Using Error Covariance

Suppose the current and candidate errors across four equally likely cases are \(e=(2,2,-2,-2)\) and \(u=(1,-1,1,-1)\). Both errors have mean zero. The current risk is \(E[e^2]=4\), and the candidate risk is \(E[u^2]=1\). Their covariance is $$ \operatorname{Cov}(e,u)=E[eu]=\frac{2-2-2+2}{4}=0. $$

For the blend weight \(\alpha=0.5\), the error difference \(e-u\) takes values \(1,3,-3,-1\), so \(E[(e-u)^2]=(1+9+9+1)/4=5\). The exact risk change is $$ R(f_{0.5})-R(f)=-2(0.5)(4-0)+(0.5)^2(5)=-4+1.25=-2.75. $$ The blended risk is therefore \(4-2.75=1.25\). The covariance identity gives the same result: \(2(0.5)(0-4)+(0.5)^2(4+1-0)=-4+1.25=-2.75\).

Choosing a Weight Along a Fixed Direction

The exact change also identifies the best unconstrained scalar weight for a fixed update direction. This is a one-dimensional quadratic calculation; it does not claim that the chosen direction is itself optimal among all possible predictors.

Result: Let \(M=E[h^2]\) and \(C=E[eh]\). If \(0<M<\infty\), the risk change is minimized over real \(\alpha\) at \(\alpha^*=C/M\), with minimum change \(-C^2/M\). If \(M=0\), the update direction is zero almost surely and the risk is unchanged for every \(\alpha\).

Derivation. For \(M>0\), complete the square: $$ R(f_\alpha)-R(f)=M\alpha^2-2C\alpha =M\left(\alpha-\frac{C}{M}\right)^2-\frac{C^2}{M}. $$ The squared term is smallest at \(\alpha=C/M\), giving the stated minimum. The minimum is strictly negative when \(C\neq 0\). If a strictly positive weight is required, an improving positive weight exists precisely when \(C>0\); if a strictly negative weight is required, one exists precisely when \(C<0\). \(\square\)

This result explains why selecting a weight and deciding whether to include a predictor are related but distinct questions. For example, a direction with \(C>0\) can improve risk at its optimal positive weight while worsening risk at a sufficiently large positive weight. If the permitted weights are restricted, the unconstrained optimum need not be permitted; the exact risk-change identity remains the criterion for any chosen value.

Worked Example: Positive Alignment Does Not Protect an Oversized Weight

Across four equally likely cases, take current errors \(e=(1,1,-1,-1)\) and update direction \(h=(1,0,0,-1)\). The current risk is \(E[e^2]=1\). The direction has mean zero, and direct calculation gives \(E[eh]=(1+0+0+1)/4=0.5\) and \(E[h^2]=(1+0+0+1)/4=0.5\). The covariance is positive, so a sufficiently small positive weight can help.

At \(\alpha=1\), the risk change is \(0.5-2(0.5)=-0.5\), and the new risk is \(0.5\). But at the larger specified weight \(\alpha=3\), the exact change is $$ R(f_3)-R(f)=3^2(0.5)-2(3)(0.5)=4.5-3=1.5. $$ The new risk is \(1+1.5=2.5\), which is higher than the original risk. The optimal unconstrained weight is \(\alpha^*=0.5/0.5=1\); weight 3 overshoots it.

Common Pitfall and Practical Interpretation

A common mistake is to conclude that positive covariance between the current error and a new contribution guarantees improvement. The exact condition shows why this is incomplete: the covariance must be large enough relative to the specified weight and the contribution’s second moment. A large contribution can overshoot, as the previous calculation demonstrates. Likewise, for nonzero-mean errors, covariance is not the whole alignment term; the product of the means must be included.

Another source of error is to use the right formula for the wrong update. Appending \(\alpha g\) while keeping the current prediction fixed uses \(h=g\). Blending with \(g\) while reducing the current ensemble’s weight uses \(h=g-f\). These updates generally have different risk changes because they move predictions in different directions. State the updated prediction first, then identify \(h\), before applying the identity.

The identity is exact for population risk under the chosen evaluation distribution. In practice, its expectations may be estimated from evaluation observations, but estimates do not turn a population identity into a guarantee about the true risk. The key conceptual check remains the same: assess the alignment of the update with current error and compare it with the update’s size at the weight actually being considered.

Key takeaway: For any update \(f_\alpha=f+\alpha h\), the exact risk change is \(\alpha^2E[h^2]-2\alpha E[eh]\). The specified weight reduces risk only when this quantity is negative; covariance determines the alignment term only when the relevant means are handled correctly.

Check Your Understanding

Use the exact risk-change identity to answer these questions.

  1. For a general update direction \(h\), what two expectations determine the risk change at weight \(\alpha\)?
  2. If both current error and update direction have mean zero, how can the alignment term be written using covariance?
  3. For a convex blend with candidate error \(u\), what is the update direction \(h\) in terms of current error \(e\) and candidate error \(u\)?
  4. Why can a direction with positive covariance with current error still increase risk at a large positive weight?
  5. What additional term is needed to express \(E[eh]\) using covariance when neither variable is assumed to have mean zero?
Clinical Biostats