Tutorials › Exam SRM - Statistics for Risk Modeling › Shrinkage As A Regularized Stagewise Update

Exam SRM · Boosting Methods · Tutorial 641 of 926

Shrinkage As A Regularized Stagewise Update

Learn to calculate and interpret shrinkage in squared-error boosting, including how it changes a fitted update and the resulting training error.

Advanced 12 min read

What You'll Learn

  • Define a stagewise update with a learning rate and a fitted tree contribution
  • Distinguish the learning rate from a line-search multiplier
  • Derive the squared-error change caused by a shrunken update
  • Compare predictions and training error for shrunken and full updates
  • Identify arithmetic and scaling errors when applying shrinkage

Why Shrink a Stagewise Update?

In squared-error boosting, each new regression tree contributes an adjustment to the model’s current predictions. A full update can fit the current residuals aggressively. Shrinkage reduces the size of that contribution: rather than adding the whole fitted tree, the algorithm adds a specified fraction of it. The result is a more cautious sequence of stagewise updates.

The learning rate controls the size of each update, not the way a tree divides the predictor space. For a fixed sequence of fitted trees, using a smaller learning rate generally means that more stages are needed to make comparably large changes. It does not guarantee lower training error at every finite stage than a full update, nor does it guarantee improved performance on new data. Its value is that it regulates the rate at which the model changes.

Definition: Let \(y_i\) be the response for observation \(i\), and let \(F_{m-1}(x_i)\) be the model prediction before stage \(m\). If \(h_m(x_i)\) is the contribution fitted at that stage, a shrunken update is $$ F_m(x_i)=F_{m-1}(x_i)+\nu h_m(x_i), $$ where \(\nu\) is the learning rate. A shrinkage learning rate satisfies \(0<\nu\leq 1\). When \(\nu=1\), the full contribution is added; when \(0<\nu<1\), only a fraction is added.

For squared-error boosting, a common construction fits \(h_m\) to the current residuals \(r_{im}=y_i-F_{m-1}(x_i)\), often using a regression tree. In a tree, each observation receives the value assigned to its terminal leaf. The learning rate multiplies that value when updating the prediction.

Some descriptions also include a scalar \(\gamma_m\), chosen to scale a candidate learner. In that notation the update is

$$ F_m(x_i)=F_{m-1}(x_i)+\nu\gamma_m h_m(x_i). $$

The two conventions agree if \(\gamma_m\) is absorbed into \(h_m\). Keep them distinct when a problem supplies a line-search multiplier: the contribution actually added is \(\nu\gamma_m h_m(x_i)\), not merely \(\nu h_m(x_i)\).

What the Learning Rate Does to Squared Error

The effect of shrinkage can be calculated directly for a fixed learner. Write \(r_i=y_i-F_{m-1}(x_i)\) for the residual before the update, and consider adding \(c h_i\), where \(c\) is the multiplier actually applied. The new residual is \(r_i-c h_i\). The sum of squared errors after the update is therefore

$$ \operatorname{SSE}(c)=\sum_{i=1}^{n}(r_i-c h_i)^2 =\sum_{i=1}^{n}r_i^2-2c\sum_{i=1}^{n}r_i h_i+c^2\sum_{i=1}^{n}h_i^2. $$

This identity explains why the update’s scale matters: the cross-product term can reduce error, while the squared-size term increases it. When \(h\) is fixed and \(\sum_i h_i^2>0\), differentiating this quadratic with respect to \(c\) gives the least-squares line-search multiplier

$$ \gamma_m=\frac{\sum_{i=1}^{n}r_i h_i}{\sum_{i=1}^{n}h_i^2}. $$

This formula applies to a fixed candidate vector \(h\) and squared-error loss. It does not apply when the denominator is zero, because then every \(h_i=0\) and the candidate makes no change. In a tree whose terminal-node values are the means of the residuals in their leaves, a full tree update already uses those fitted residual means; a separate line-search multiplier may be omitted or incorporated into the tree values.

Derivation: If \(\gamma_m\) minimizes squared error for the fixed learner, then the derivative of \(\operatorname{SSE}(c)\) at \(c=\gamma_m\) is zero. Thus \(\sum_i r_i h_i=\gamma_m\sum_i h_i^2\). With shrinkage, the applied multiplier is \(c=\nu\gamma_m\). Substituting into the squared-error identity shows that the reduction from the pre-update error is $$ \operatorname{SSE}(0)-\operatorname{SSE}(\nu\gamma_m) =(2\nu-\nu^2)\gamma_m^2\sum_{i=1}^{n}h_i^2. $$ For \(0<\nu<1\), this is positive when the fitted contribution is nonzero, so the update reduces training error. Its reduction is a fraction \(\nu(2-\nu)\) of the reduction from the full line-search update—not simply a fraction \(\nu\).

The derivation concerns one fixed learner and squared error. It does not establish that a smaller learning rate always gives lower error after the same number of stages: the smaller step may simply have made less progress. Nor does it establish that a training-error decrease will improve prediction on unseen observations. Shrinkage is a regularizing control on the pace of fitting, rather than a guarantee about every performance measure.

Worked Example: Shrinking a Tree That Fits the Residuals

A hypothetical model has three observations with responses \(y=(5,1,-3)\) and initial predictions \(F_0=(0,0,0)\). A tree has one observation in each of three leaves and returns the residual values \(h_1=(5,1,-3)\). Compare the full update with an update using learning rate \(\nu=0.25\).

Method. The fitted tree contribution is the residual vector, so the full update adds \(h_1\), while the shrunken update adds \(0.25h_1\).

With the full update, the predictions are

$$ F_1=(0,0,0)+(5,1,-3)=(5,1,-3). $$

The residuals are \((0,0,0)\), so the sum of squared errors is \(0\).

With shrinkage, the contribution added is \(0.25(5,1,-3)=(1.25,0.25,-0.75)\). The predictions become \(F_1=(1.25,0.25,-0.75)\). Subtracting these predictions from the responses gives residuals

$$ (5-1.25,\;1-0.25,\;-3-(-0.75))=(3.75,0.75,-2.25). $$

The squared-error calculation is \(3.75^2=14.0625\), \(0.75^2=0.5625\), and \((-2.25)^2=5.0625\). Therefore,

$$ \operatorname{SSE}=14.0625+0.5625+5.0625=19.6875. $$

Check. The shrunken residuals are exactly \(0.75\) times the original residuals, so their squared-error sum is \(0.75^2(25+1+9)=0.5625(35)=19.6875\), agreeing with the direct calculation. Common mistake avoided: the three squared residuals do not sum to \(24.5\); adding the displayed terms gives \(19.6875\).

Worked Example: Applying Both a Line-Search Multiplier and Shrinkage

Suppose responses are \(y=(5,1,-3)\), current predictions are \(F_0=(1,1,1)\), and a candidate tree has outputs \(h=(2,0,-2)\). Find the least-squares scalar \(\gamma\), then calculate the predictions and squared error after applying learning rate \(\nu=0.25\). Also compare with the full line-search update.

Step 1: Find the current residuals. Subtract the current predictions from the responses: \(r=(5-1,1-1,-3-1)=(4,0,-4)\).

Step 2: Calculate the line-search multiplier. The numerator is \(\sum_i r_i h_i=4(2)+0(0)+(-4)(-2)=16\). The denominator is \(\sum_i h_i^2=2^2+0^2+(-2)^2=8\). Hence \(\gamma=16/8=2\).

Step 3: Apply shrinkage to the scaled learner. The effective multiplier on \(h\) is \(\nu\gamma=0.25(2)=0.5\), so the new predictions are

$$ F_1=(1,1,1)+0.5(2,0,-2)=(2,1,0). $$

The residuals are \(y-F_1=(3,0,-3)\), giving \(\operatorname{SSE}=3^2+0^2+(-3)^2=18\). The initial squared error was \(4^2+0^2+(-4)^2=32\).

Full-update comparison. With \(\nu=1\), the effective multiplier is \(\gamma=2\), and the predictions are \((1,1,1)+2(2,0,-2)=(5,1,-3)\). The squared error is \(0\).

Check and common mistake avoided. The computed line-search scalar is \(2\), so the shrunken step is \(0.25(2)h=0.5h\). Multiplying \(h\) by \(0.25\) while ignoring \(\gamma\) would instead give predictions \((1.5,1,0.5)\), which is not the update specified here.

Worked Example: Several Small Updates Versus One Full Update

A hypothetical response sample is \(y=(4,0)\), with initial predictions \(F_0=(0,0)\). At each stage, fit a constant tree to the mean of the current residuals. Use \(\nu=0.5\) for two stages, and compare the resulting predictions and squared error with one full update.

First shrunken stage. The initial residuals are \((4,0)\), whose mean is \(2\). The tree predicts \(h_1=(2,2)\). Adding half gives \(F_1=(1,1)\), so the new residuals are \((3,-1)\).

Second shrunken stage. The mean of \((3,-1)\) is \(1\), so the next constant tree predicts \(h_2=(1,1)\). Adding half gives \(F_2=(1,1)+(0.5,0.5)=(1.5,1.5)\). The residuals are \((4-1.5,0-1.5)=(2.5,-1.5)\), and

$$ \operatorname{SSE}=2.5^2+(-1.5)^2=6.25+2.25=8.5. $$

Full-update comparison. With \(\nu=1\), the first tree adds \((2,2)\), producing predictions \((2,2)\) and residuals \((2,-2)\). Their mean is zero, so the next constant tree contributes zero. The squared error remains \(2^2+(-2)^2=8\).

Check. The full update has lower training error after these two stages, \(8\) rather than \(8.5\), because it reaches the overall mean in one step. The shrunken updates move toward that same mean more gradually. Common mistake avoided: shrinkage does not mean that a fixed number of shrunken stages must outperform a full update on training error.

Interpreting Shrinkage and Avoiding Traps

A learning rate acts on the contribution at every stage. If the learner is supplied with a line-search multiplier, both quantities must be used. For instance, a learner value of \(h_i\), line-search multiplier \(\gamma_m\), and learning rate \(\nu\) produce an increment \(\nu\gamma_m h_i\). Confusing these factors changes the predictions and the residuals at every later stage.

  • Do not shrink the current prediction. The update is \(F_{m-1}+\nu h_m\), not \(\nu F_{m-1}+h_m\). Only the new learner’s contribution is scaled.
  • Do not discard a supplied scalar multiplier. If the update includes \(\gamma_m\), multiply the learner by \(\nu\gamma_m\).
  • Do not confuse a smaller step with a different tree. Shrinkage scales the contribution after it is fitted; it does not, by itself, change the tree’s splits or leaf assignments.
  • Do not overstate what the training calculation proves. For a fixed learner and \(0<\nu<1\), a line-search-based squared-error update reduces training error. That fact alone says nothing conclusive about test error.
  • Do not treat \(\nu\) as an additive adjustment. A learning rate of \(0.25\) means one quarter of the fitted contribution, not a subtraction of \(0.25\) from each tree value.

In practice, the learning rate and number of stages are considered together: smaller steps typically require more stages to accumulate a comparable total change. The central calculation remains simple, but the distinction between the fitted learner, any line-search multiplier, and the learning rate is essential. These shrinkage calculations are aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus.

Check Your Understanding

For each problem, track the residuals and the actual increment carefully. Unless stated otherwise, use the sum of squared errors without dividing by the sample size.

  1. Responses are \(y=(7,3)\), current predictions are \(F_0=(3,3)\), and a candidate learner is \(h=(2,-1)\). Find the least-squares multiplier \(\gamma\), then apply \(\nu=0.5\). Give the new predictions and squared error. (Answer: \(\gamma=1.6\); predictions \((4.6,2.2)\); SSE \(=6.4\))
  2. The current residual vector is \(r=(2,-2,1)\), a fixed learner is \(h=(1,-1,0.5)\), and \(\nu=0.25\). Find \(\gamma\), the updated residual vector, and the new squared-error sum. (Answer: \(\gamma=2\); updated residuals \((1.5,-1.5,0.75)\); SSE \(=5.0625\))
  3. Responses are \(y=(6,2,0)\), initial predictions are all zero, and each stage fits a constant tree to the mean residual. Use \(\nu=0.5\) for two stages. Find the final common prediction and squared error. (Answer: prediction \(2\) for each observation; SSE \(=20\))
  4. A full line-search update has \(\gamma=1.5\), \(\sum_i h_i^2=10\), and the pre-update squared error is \(50\). If \(\nu=0.4\), calculate the shrunken squared-error reduction and the resulting squared error. (Answer: reduction \(14.4\); resulting SSE \(35.6\))
  5. Initial predictions are zero. A tree has two leaves: the first contains residuals \((3,1)\), and the second contains residuals \((-2,-4)\). Set each leaf value to its residual mean and apply \(\nu=0.5\). Find the leaf values, the four updated predictions in observation order, and the resulting SSE. (Answer: leaf values \((2,-3)\); predictions \((1,1,-1.5,-1.5)\); SSE \(=10.5\))
Clinical Biostats