Riley 2020 - Shrinkage and Optimism Criteria for Overfitting

Summary

Steps 3-4 are the overfitting criteria and usually bind. Step 3: choose so that the expected uniform shrinkage factor is ( shrinkage): (Fig 3). For , this gives 1698, which is EPP 8.5 at prevalence 0.1 but EPP 25.5 at prevalence 0.3. Step 4: choose so that the apparent Nagelkerke is optimistic by at most . Set and reuse the Fig 3 formula (Fig 5). For , , this gives 1079. The authors aim to avoid needing shrinkage, because estimated shrinkage is least reliable exactly when it is most needed.

Overview

The paper sets this step up around one definition and one paradox. Small samples cause overfitting. Shrinkage (penalisation, regularisation) is the textbook remedy. But the amount of shrinkage is itself estimated from the same small sample. So the paper designs the sample so that little shrinkage is needed to begin with.

Main Content

Overfitting and shrinkage (p. 3)

Definition: Overfitting and shrinkage (p. 3)

Overfitting: a developed model’s predictions are more extreme than they ought to be for individuals in a new dataset from the same target population. For a binary outcome, predicted probabilities are too close to 1 for above-average-risk individuals and too close to 0 for below-average-risk individuals. It occurs notably when is large relative to (continuous outcomes) or to the number of events (binary, time-to-event). Consequence: apparent performance (in the development data) is optimistic, and actual performance in new data is worse.

Shrinkage (penalisation, regularisation): methods that reduce the variability of predictions, pulling extreme predictions back toward the overall average. A uniform shrinkage factor multiplies all predictor effects (, intercept re-estimated). is the proportional shrinkage.

The shrinkage paradox (p. 3)

Shrinkage is not guaranteed to fix overfitting:

  1. Shrinkage and penalty factors are estimated from the development data. In small samples they are imprecise and can mis-size the correction (van Houwelingen 2001, ref 30).
  2. Estimated required shrinkage is negatively correlated with apparent performance. When apparent fit is excellent by chance, required shrinkage is estimated too low.

Verbatim (p. 3): “ironically, in those situations when overfitting is of most concern (and thus shrinkage is most urgently needed), the prediction model developer has insufficient assurance in selecting the proper amount of shrinkage to cancel the impact of overfitting.”

Implication: target a sample size and candidate-parameter count at which only a small amount of shrinkage () is expected.

Step 3: the shrinkage criterion (Fig 3)

Criterion B3 / T2: sample size for expected shrinkage (Fig 3, p. 10; Riley et al. 2019 Part II)

For binary or time-to-event outcomes, the number of participants needed for an expected uniform shrinkage factor is

where = number of candidate predictor parameters, = anticipated (optimism-adjusted) Cox-Snell of the new model (definition), and the recommended target is .

Requirements: prespecify ; for binary/survival outcomes the anticipated outcome proportion or rate (to translate into events and to bound ); a conservative anticipated (Fig 4). Note is needed for the log to exist.

Proof sketch (reconstruction; the PDF states only the formula). (i) The van Houwelingen-le Cessie heuristic shrinkage is , where LR is the model’s likelihood-ratio . (ii) The Cox-Snell definition gives , so . (iii) The optimism-adjusted is approximately , so . (iv) Substitute: . Solving for gives the formula.

Fig 3 worked example (p. 10)

, , :

  • Outcome proportion 0.1: events, EPP .
  • Outcome proportion 0.3: EPP .

The required EPP changes greatly because is a much smaller fraction of max() at prevalence 0.3 (max 0.71) than at 0.1 (max 0.48). The same absolute therefore means weaker relative signal at the higher prevalence.

Signal:noise intuition (p. 3). High anticipated (near 1, possible for continuous outcomes) means true patterns are easy to detect, overfitting is less of a concern, and more parameters can be estimated. Low (near 0) means patterns are hard to find, overfitting risk is larger, and fewer parameters can be estimated reliably. Required is very sensitive to , so choose it conservatively.

Continuous outcome (p. 3; supplementary S4)

For a continuous outcome, is the ordinary . With up to predictor parameters and anticipated , 206 participants give expected shrinkage of 10%, about 7 participants per parameter.

Caveat recorded on ingest: plugging these values into the Fig 3 binary formula gives about 199.5, not 206. The continuous-outcome criterion in S4 (Riley et al. 2019 Part I) is a separate expression that is not included in the PDF. Use pmsampsize, type(c) rather than the Fig 3 formula for continuous outcomes.

Step 4: the optimism criterion (Fig 5)

Optimism in apparent model fit (p. 4)

The apparent is computed on the development data. The optimism-adjusted value is an approximately unbiased estimate of fit in the target population. Optimism is apparent minus adjusted. Target a small optimism, e.g. .

Criterion B4 / T3: sample size for optimism (Fig 5, p. 12; continuous C4 uses supplementary S6 instead)

First find the shrinkage factor corresponding to expected optimism in :

Then substitute into the Fig 3 formula .

Proof sketch (reconstruction). Apparent , so optimism in the Nagelkerke scale is . Solving for gives the expression above.

Worked example: logistic model, anticipated , so , :

so at least 1079 participants for .

Numerical note: using unrounded gives . The paper’s 1078.9 comes from rounding to 0.924. Either way, rounding up to the next integer is the convention.

Which binds? Steps 3 and 4 both translate into a required . B4’s is below 0.9 whenever , i.e. for , and then B3 (with ) binds. That covers most clinical models, where is typically 0.1-0.2 (Fig 4). B4 binds only for models with high relative fit.

Examples

Verified computation (python)

import math
def n_shrink(P, R2cs, S=0.9):
    return P / ((S - 1) * math.log(1 - R2cs / S))
def S_optimism(R2cs, maxR2, delta=0.05):
    return R2cs / (R2cs + delta * maxR2)
print(round(n_shrink(20, 0.1)))                  # 1698
S = S_optimism(0.2, 0.33); print(round(S, 3))   # 0.924
print(round(n_shrink(20, 0.2, 0.924), 1))       # 1078.9

Marketing-analytics reading

How many parameters can 104 weeks support? (illustrative, not from the paper)

Treat a weekly sales regression as a continuous-outcome development problem and, as a rough guide only, use the Fig 3 expression (see the continuous caveat above). For candidate parameters and :

anticipated out-of-sample required (weeks)
0.3about 888
0.5about 444
0.7about 239

Two years of weekly data (104 rows) fall well short unless the honest, out-of-sample is very high. In-sample from a model with trend and seasonality is not the right input; it is the optimistic quantity this criterion guards against. Autocorrelated rows carry less information than independent ones, so the true shortfall is larger. Practical responses mirror the paper’s: reduce candidate parameters (fix adstock forms from prior evidence), use informative priors as structured shrinkage (Bayesian Estimation and Priors for MMM), or pool across markets or segments.

Connections

See Also