Why a Biased Coefficient Can Predict Better
Penalization deliberately pulls fitted coefficients toward a target, usually zero. That makes coefficient estimates biased when the target is not the true coefficient. Yet the aim of a predictive model is not necessarily to recover every coefficient without bias: it is to predict well on new data. A small, systematic displacement can be worthwhile if it reduces the variability of predictions enough to lower their average out-of-sample error.
The relevant trade-off depends on the prediction target and loss. Squared error for a predicted mean leads to an exact bias–variance decomposition. For a GLM's predictive distribution, expected negative log-likelihood has a different but closely related interpretation: its excess over the true model's risk is a Kullback–Leibler divergence. These provide precise ways to discuss when shrinkage helps, and why coefficient bias by itself does not answer the question.
Prediction Risk and Its Decomposition
Let \(X\) denote the training data, and let \(\hat\beta\) be a coefficient estimator computed from \(X\). At a fixed covariate vector \(x\), write \(\hat\mu(x)\) for its predicted conditional mean, and let \(\mu_0(x)=E[Y\mid x]\) be the true conditional mean. The training data are random, so \(\hat\mu(x)\) is random even when the prediction point \(x\) is fixed.
For any estimator with finite second moment, the risk decomposes exactly. This statement concerns the predicted quantity, not automatically the coefficient vector.
Set \(m=E_X[\hat\mu(x)]\). Then \(\hat\mu-\mu_0=(\hat\mu-m)+(m-\mu_0)\).
The cross term has expectation \(2(m-\mu_0)E_X[\hat\mu-m]=0\).
The remaining terms are \(E_X[(\hat\mu-m)^2]=\operatorname{Var}_X(\hat\mu)\) and \((m-\mu_0)^2\). Thus the identity holds. \(\square\)
If the target is a future response \(Y_{\mathrm{new}}\) at \(x\), and it is conditionally independent of the training data given \(x\), then \(E[(Y_{\mathrm{new}}-\hat\mu(x))^2]=\operatorname{Var}(Y_{\mathrm{new}}\mid x)+R_\mu(x)\). The first term is irreducible response variation; an estimator cannot remove it. Comparing two fits under squared prediction error therefore reduces to comparing their risks for the conditional mean.
For a linear predictor \(\hat\beta\) and a fixed vector \(c\), the same algebra gives \(E[(c^\mathsf{T}\hat\beta-c^\mathsf{T}\beta_0)^2]=(c^\mathsf{T}\operatorname{Bias}(\hat\beta))^2+c^\mathsf{T}\operatorname{Cov}(\hat\beta)c\). A GLM's mean prediction is generally a nonlinear function of \(x^\mathsf{T}\hat\beta\), so this coefficient identity is not, by itself, an exact decomposition for that mean. For a smooth inverse link \(h=g^{-1}\), a local approximation around \(\beta_0\) uses the gradient \(a(x)=h'(x^\mathsf{T}\beta_0)x\): the prediction error is approximately \(a(x)^\mathsf{T}(\hat\beta-\beta_0)\). Its approximate risk is therefore the squared projected bias plus projected covariance. This is a local approximation, not a universal exact formula.
Worked Example: Ridge Risk With Orthogonal Predictors
Consider \(Y=X\beta_0+\varepsilon\), with fixed design satisfying \(X^\mathsf{T}X=nI\), and errors having mean zero and covariance \(\sigma^2 I\). The ridge estimator with penalty \(\lambda>0\) is \(\hat\beta_\lambda=(X^\mathsf{T}X+\lambda I)^{-1}X^\mathsf{T}Y\). Take \(n=10\), \(\sigma^2=1\), \(\lambda=2\), and two true coefficients \((1,0.2)\).
Since \(X^\mathsf{T}X=10I\), each fitted coefficient is \(\hat\beta_{\lambda,j}=\frac{10}{12}\beta_{0,j}+\frac{1}{12}x_j^\mathsf{T}\varepsilon\). Its expectation is \(\frac{10}{12}\beta_{0,j}\), so its bias is \(-\frac{2}{12}\beta_{0,j}\). Its variance is \(\frac{1}{12^2}\operatorname{Var}(x_j^\mathsf{T}\varepsilon)=\frac{1}{144}\sigma^2 x_j^\mathsf{T}x_j=\frac{10}{144}\).
For prediction at a new covariate distribution with \(E[xx^\mathsf{T}]=I\), the mean-prediction risk is \(E_X[\|\hat\beta_\lambda-\beta_0\|^2]\), the sum of the two coefficient mean squared errors. Coordinate \(j\)'s contribution is \(\frac{4\beta_{0,j}^2+10}{144}\). For the first coefficient this is \((4+10)/144=0.09722\), compared with the unpenalized variance \(1/10=0.1\). For the second it is \((4(0.2)^2+10)/144=10.16/144=0.07056\), also below \(0.1\). Total risk is approximately \(0.16778\), compared with \(0.2\) for least squares. The ridge estimates are biased, but under these stated conditions their lower variance more than compensates in prediction risk.
More generally, the coordinate risk is \(\frac{\lambda^2\beta_{0,j}^2+n\sigma^2}{(n+\lambda)^2}\), while least squares has risk \(\sigma^2/n\). Ridge improves this coordinate's risk exactly when \(n\lambda^2\beta_{0,j}^2+n^2\sigma^2<\sigma^2(n+\lambda)^2\), or equivalently \(\beta_{0,j}^2<\sigma^2(2n+\lambda)/(n\lambda)\). This verifies that improvement depends on the signal size as well as the penalty and noise.
GLM Prediction Loss and Kullback–Leibler Risk
Squared error is natural for a conditional mean, but GLMs also provide a predictive distribution. Suppose the response has a canonical exponential-family distribution \(f(y\mid\theta,\phi)=\exp\{[y\theta-b(\theta)]/a(\phi)+c(y,\phi)\}\), with known \(a(\phi)>0\), and the true conditional canonical parameter at \(x\) is \(\theta_0\). The mean is \(b'(\theta_0)\). Compare the expected negative log-likelihood of a fitted canonical parameter \(\theta\) with that of the truth, averaging the response under the true distribution.
To derive the equality, subtract the two negative log densities. The terms \(c(Y,\phi)\) cancel, leaving \(\{b(\theta)-b(\theta_0)-Y(\theta-\theta_0)\}/a(\phi)\). Taking expectation and using \(E_{\theta_0}[Y]=b'(\theta_0)\) gives the displayed expression. By definition, the expected log density ratio \(E_{\theta_0}[\log\{f(Y\mid\theta_0,\phi)/f(Y\mid\theta,\phi)\}]\) is the Kullback–Leibler divergence. Convexity of \(b\) gives \(b(\theta)\ge b(\theta_0)+b'(\theta_0)(\theta-\theta_0)\), proving nonnegativity. \(\square\)
For a random fitted parameter, predictive log-loss risk averages this divergence over training samples. If \(b\) has a continuous third derivative near \(\theta_0\), Taylor expansion gives excess risk \(\frac{b''(\theta_0)}{2a(\phi)}(\theta-\theta_0)^2+O(|\theta-\theta_0|^3)\). Thus, for estimates close enough to the truth and with controlled remainder, the leading term again rewards a trade-off: squared bias in the prediction-relevant parameter versus its variance. It does not say that all penalties reduce risk, nor that minimizing coefficient error and minimizing log loss are identical objectives.
Worked Example: Shrinking a Logistic Prediction
Let \(Y\sim\operatorname{Binomial}(2,p)\) with true \(p=0.65\), so the true logistic intercept is \(\beta_0=\log(0.65/0.35)=\log(13/7)\), approximately \(0.6190\). Define a finite small-sample logistic estimate by add-one smoothing: \(\tilde\beta=\log\{(Y+1)/(2-Y+1)\}\). Compare its fitted probability \(\operatorname{expit}(\tilde\beta)\) with the coefficient-shrunk estimate \(\operatorname{expit}(0.5\tilde\beta)\), using squared error for predicting \(p\) across repeated samples.
The possible outcomes \(Y=0,1,2\) have probabilities \(0.35^2=0.1225\), \(2(0.65)(0.35)=0.455\), and \(0.65^2=0.4225\). The smoothed coefficient estimates are \(-\log 3,0,\log 3\), giving unshrunk predictions \(0.25,0.5,0.75\). Their risk is \(0.1225(0.25-0.65)^2+0.455(0.5-0.65)^2+0.4225(0.75-0.65)^2 =0.0196+0.0102375+0.004225=0.0340625\).
After halving the coefficient, the endpoint predictions are \(\operatorname{expit}(\tfrac12\log 3)=\sqrt{3}/(1+\sqrt{3})\approx0.633975\); the middle prediction remains \(0.5\). The risk is \((0.1225+0.4225)(0.633975-0.65)^2+0.455(0.5-0.65)^2 \approx0.545(0.0002568)+0.0102375\approx0.01038\). Here coefficient shrinkage introduces bias but substantially lowers repeated-sample prediction risk. This comparison is specific to the stated estimator, sample size, truth, and loss.
Worked Example: Poisson Log Loss Can Also Improve
At one fixed covariate value, suppose the true response is Poisson with canonical parameter \(\eta_0=0.5\), so its mean is \(\lambda_0=e^{0.5}\). Consider a hypothetical training procedure whose unpenalized coefficient estimate is \(0.1\) or \(0.9\), each with probability \(1/2\). Its mean is \(0.5\), so it is unbiased. Shrink its coefficient by a factor of \(0.6\) toward zero and compare expected test negative log-likelihood.
For a Poisson model, \(b(\eta)=e^\eta\), \(a(\phi)=1\). The excess expected log loss at estimate \(\hat\eta\) is exactly \(e^{0.5}\{e^\delta-1-\delta\}\), where \(\delta=\hat\eta-0.5\). Before shrinkage, \(\delta=-0.4\) or \(0.4\). The two excess risks are \(e^{0.5}(e^{-0.4}-1+0.4)\approx0.1159\) and \(e^{0.5}(e^{0.4}-1-0.4)\approx0.1514\). Their average is approximately \(0.1337\).
The shrunken estimates are \(0.06\) and \(0.54\), so the errors are \(-0.44\) and \(0.04\). Their excess risks are \(e^{0.5}(e^{-0.44}-1+0.44)\approx0.1386\) and \(e^{0.5}(e^{0.04}-1-0.04)\approx0.00134\). The average is approximately \(0.0700\), lower than before shrinkage. The shrunken coefficient has expectation \(0.3\), not \(0.5\), so this gain comes with bias. The calculation illustrates log-loss risk for a specified estimator distribution; it is not a general guarantee for Poisson penalization.
What the Trade-Off Does—and Does Not—Tell Us
In applications, prediction risk is usually averaged over a distribution of future covariates as well as repeated training samples. A penalty can help at some covariate values and hurt at others; the overall answer depends on how those values are weighted and on the chosen loss. Cross-validation, covered in the earlier material on penalty selection, estimates predictive performance under a validation design. It is useful precisely because the unknown risk cannot usually be computed from the fitted coefficients alone.
- Bias is not automatically a defect for prediction. A biased prediction can have lower risk if its variance falls enough.
- Coefficient bias is not the prediction target. In a GLM, a coefficient change affects predictions through covariates and the inverse link; some directions matter more for the prediction region than others.
- No penalty wins universally. A strong penalty can overshrink important signal and increase prediction error. The loss, data-generating process, and target covariate distribution all matter.
A common mistake is to conclude, “The penalized coefficients are biased, so their predictions must be worse.” That confuses a parameter property with an expected prediction loss. The correction is to state the target and loss, then compare the bias and variance of the relevant predictions—or compare expected out-of-sample loss directly. The reverse mistake is also possible: observing that shrinkage often stabilizes predictions does not establish that any particular penalty improves risk.
Check Your Understanding
Use the target and loss explicitly in each answer.
- State the exact bias–variance decomposition for squared error in predicting a conditional mean at fixed \(x\).
- Why does the risk for predicting a new response include a term that cannot be reduced by changing the fitted coefficients?
- In the orthogonal ridge example, which quantities determine whether the risk for one coefficient improves over least squares?
- For a canonical exponential-family GLM, what quantity equals the excess expected negative log-likelihood at a fixed prediction point?
- Give one reason that coefficient shrinkage might lower prediction risk and one reason it might raise it.