Tutorials › Generalized Linear Models › Penalized Prediction Versus Classical Inference

Penalized GLM Estimation · Tutorial 919 of 981

Penalized Prediction Versus Classical Inference

Understand the target, bias, and sampling variance of penalized GLM estimates—and why classical coefficient inference needs more than the usual likelihood standard errors.

Advanced 11 min read

What You'll Learn

  • Distinguish a penalized estimate’s population target from the true GLM parameter
  • Derive the sandwich covariance around a fixed penalized target
  • See why information equality may fail at a penalized target
  • Calculate shrinkage bias and sampling variance in ridge examples
  • Identify why ordinary Wald tests and post-selection intervals can mislead
  • Recognize conditions under which a vanishing penalty may permit classical inference

Why Prediction and Coefficient Inference Can Diverge

Penalization can improve prediction by stabilizing estimates, especially when predictors are numerous or strongly related. But a coefficient chosen to optimize a penalized objective is generally not an ordinary maximum-likelihood estimate: the penalty deliberately pulls it away from values favored by the data likelihood. Thus a useful prediction rule need not provide an unbiased estimate of the corresponding population coefficient, and the usual likelihood standard error does not automatically quantify uncertainty about that coefficient.

The distinction is between a penalized target, the population value toward which a penalized procedure converges, and the true parameter in a correctly specified GLM. Inference around the penalized target is not, by itself, inference about the true parameter. The gap matters most when the penalty remains appreciable as the sample size grows or when tuning and variable selection are performed using the same data.

The Penalized Target and Its Bias

Let \(Y_1,\ldots,Y_n\) be independent and identically distributed observations, and let \(\ell_i(\beta)\) be the log-likelihood contribution for observation \(i\), with coefficient vector \(\beta\). For a fixed penalty level \(\rho\geq 0\) and a differentiable penalty \(P(\beta)\), consider the estimator

$$ \hat\beta_\rho = \arg\max_\beta \left\{ \frac{1}{n}\sum_{i=1}^n \ell_i(\beta)-\rho P(\beta) \right\}. $$

This scaling makes \(\rho\) the penalty relative to the average log-likelihood. Other software conventions may multiply the likelihood or penalty by \(n\); the substantive comparison is unchanged once the scaling is translated. For example, ridge uses \(P(\beta)=\tfrac12\beta^\mathsf{T}\beta\), often with the intercept excluded from the penalty.

Definition: A penalized population target \(\beta_\rho\) is an interior solution of
$$ E[s_i(\beta_\rho)]-\rho\nabla P(\beta_\rho)=0, \qquad s_i(\beta)=\nabla\ell_i(\beta). $$
When this solution is unique and regular, it is the value approached by the estimator under standard fixed-dimensional large-sample conditions. The penalized bias relative to a true parameter \(\beta_0\) is \(\beta_\rho-\beta_0\), not the random difference \(\hat\beta_\rho-\beta_\rho\).

If the likelihood is correctly specified, \(E[s_i(\beta_0)]=0\). But at \(\beta_0\), the penalized population equation has left-hand side \(-\rho\nabla P(\beta_0)\). Unless this penalty gradient is zero, or the penalty vanishes, \(\beta_0\) is not the penalized target. This is the mechanism behind shrinkage bias. The amount and direction of that bias depend on the penalty and its tuning parameter.

Worked Example: A Ridge-Penalized Gaussian Intercept

Suppose \(Y_i\) are independent with \(Y_i\sim N(\beta,4)\), where the variance is known and the true intercept is \(\beta_0=2\). Use the penalty \(P(\beta)=\beta^2/2\) and \(\rho=0.25\).

Ignoring constants, the average log-likelihood is \(-\frac{1}{8n}\sum_i(Y_i-\beta)^2\). Its derivative is \((\bar Y-\beta)/4\). The penalized estimating equation is therefore

$$ \frac{\bar Y-\hat\beta_\rho}{4}-0.25\hat\beta_\rho=0, \qquad \hat\beta_\rho=\frac{\bar Y}{2}. $$

Since \(E[\bar Y]=2\), the penalized target is \(\beta_\rho=1\), so the bias relative to the true intercept is \(1-2=-1\). Since \(\operatorname{Var}(\bar Y)=4/n\), the estimator variance is

$$ \operatorname{Var}(\hat\beta_\rho) =\frac14\operatorname{Var}(\bar Y) =\frac{1}{n}. $$

At \(n=100\), its variance is \(0.01\), and its mean squared error for estimating \(\beta_0=2\) is \(0.01+(-1)^2=1.01\). The unpenalized sample mean has variance \(4/100=0.04\) and zero bias, so its mean squared error is \(0.04\) in this particular example. Penalization is not guaranteed to improve coefficient mean squared error; its value depends on the prediction or estimation objective and the setting.

Sampling Variance Around a Fixed Penalized Target

For a smooth penalty and a fixed \(\rho\), uncertainty around \(\beta_\rho\) can be derived using the estimating equation. Write

$$ J(\beta_\rho)=-E[\nabla s_i(\beta_\rho)], \qquad \Omega(\beta_\rho)=\operatorname{Var}(s_i(\beta_\rho)), \qquad A(\beta_\rho)=J(\beta_\rho)+\rho\nabla^2P(\beta_\rho). $$

Here \(J\) is the expected negative likelihood Hessian, \(\Omega\) is the covariance of the individual likelihood scores, and \(A\) is the derivative curvature of the penalized population estimating equation, with sign reversed. Suppose the observations are iid; the parameter dimension is fixed; \(\beta_\rho\) is an interior solution; \(P\) and the log-likelihood contributions are twice continuously differentiable near it; the required score second moments are finite; \(A(\beta_\rho)\) is nonsingular; and standard uniform laws of large numbers, a central limit theorem, and a Taylor expansion with a negligible remainder hold. Also suppose the estimator converges in probability to this solution.

Theorem: Under the conditions just stated,
$$ \sqrt n(\hat\beta_\rho-\beta_\rho) \xrightarrow{d} N\!\left( 0,\, A(\beta_\rho)^{-1}\Omega(\beta_\rho)A(\beta_\rho)^{-\mathsf T} \right). $$
Thus the first-order covariance of \(\hat\beta_\rho\) around its penalized target is \(n^{-1}A^{-1}\Omega A^{-\mathsf T}\). If the matrices are symmetric, as in the usual smooth likelihood and penalty setting, \(A^{-\mathsf T}=A^{-1}\).

Proof. The estimator satisfies the sample penalized score equation. Expand it about \(\beta_\rho\), whose population equation is zero. The derivative of the sample equation converges in probability to \(-A(\beta_\rho)\). Consequently,

$$ 0 = \frac{1}{n}\sum_{i=1}^n s_i(\beta_\rho) -\rho\nabla P(\beta_\rho) -A(\beta_\rho)(\hat\beta_\rho-\beta_\rho) +o_p(n^{-1/2})+o_p(\|\hat\beta_\rho-\beta_\rho\|). $$

The first two terms together have mean zero by the target equation. The central limit theorem gives \(n^{-1/2}\sum_i s_i(\beta_\rho)\xrightarrow{d}N(0,\Omega(\beta_\rho))\). Nonsingularity of \(A\), the Taylor expansion, and consistency yield the first-order representation

$$ \sqrt n(\hat\beta_\rho-\beta_\rho) = A(\beta_\rho)^{-1}\frac{1}{\sqrt n}\sum_{i=1}^n s_i(\beta_\rho)+o_p(1). $$

Applying the central limit theorem and the continuous mapping theorem gives the stated covariance. The penalty changes the curvature through \(A\), but it contributes no random score term when \(\rho\) is fixed. \(\square\)

The theorem is about a smooth, fixed-penalty estimator and its target. It does not say that a usual likelihood standard error is valid for inference about \(\beta_0\). Nor does it directly cover a nonsmooth penalty such as the lasso at a coefficient equal to zero: there the derivative used in this argument may not exist, and the limiting distribution can behave differently.

Information Equality Must Be Evaluated at the Right Parameter

Under a correctly specified, regular likelihood, the information equality states that \(\Omega(\beta_0)=J(\beta_0)\) at the true parameter \(\beta_0\). It does not license replacing \(\Omega(\beta_\rho)\) by \(J(\beta_\rho)\) when the penalized target differs from the true parameter. At that target, the likelihood score may have nonzero expectation, and its variance need not equal the expected negative Hessian.

Even in a correctly specified model, the theorem’s sandwich covariance must therefore use \(\Omega\) evaluated at \(\beta_\rho\), unless the target coincides with \(\beta_0\) and the regularity conditions for information equality hold there. A positive penalty also contributes \(\rho\nabla^2P(\beta_\rho)\) to \(A\); this curvature contribution is not itself a source of random score variation.

Worked Example: Logistic Intercept and Unequal Score Variance

Let \(Y_i\) be Bernoulli with true success probability \(p_0=0.8\). Fit a logistic intercept \(\beta\), so the fitted probability is \(q(\beta)=\operatorname{logit}^{-1}(\beta)\). Use ridge penalty \(P(\beta)=\beta^2/2\). Choose a positive penalty so that the penalized target has fitted probability \(q_\rho=0.6\).

The individual likelihood score is \(s_i(\beta)=Y_i-q(\beta)\). At the proposed target,

$$ \beta_\rho=\log\!\left(\frac{0.6}{0.4}\right)=\log(1.5)\approx0.4055. $$

The population penalized score equation requires \(0.8-0.6-\rho\beta_\rho=0\), so

$$ \rho=\frac{0.2}{\log(1.5)}\approx0.4933. $$

The expected negative likelihood Hessian is \(J(\beta_\rho)=q_\rho(1-q_\rho)=0.24\). But the score at the target is \(Y_i-0.6\), whose variance is the variance of \(Y_i\), namely

$$ \Omega(\beta_\rho)=\operatorname{Var}(Y_i-0.6) =\operatorname{Var}(Y_i)=0.8(0.2)=0.16. $$

Thus \(\Omega(\beta_\rho)\ne J(\beta_\rho)\). The penalty curvature is \(\rho\), so \(A=0.24+0.4933=0.7333\), and the asymptotic variance around \(\beta_\rho\) is approximately \(0.16/(0.7333^2n)=0.2976/n\). This is uncertainty around \(\log(1.5)\), not around the true intercept \(\operatorname{logit}(0.8)=\log(4)\approx1.3863\). The target’s difference from the truth is about \(-0.9808\), which does not disappear as \(n\) grows with this fixed penalty.

Worked Example: A Poisson Intercept at a Penalized Target

Suppose \(Y_i\) are iid Poisson with true mean \(2\), and fit a Poisson intercept \(\beta\), with fitted mean \(\mu(\beta)=e^\beta\). Use \(P(\beta)=\beta^2/2\). Consider the target \(\beta_\rho=\log(1.5)\). The likelihood score is \(s_i(\beta)=Y_i-e^\beta\), so the target equation gives

$$ 2-1.5-\rho\log(1.5)=0, \qquad \rho=\frac{0.5}{\log(1.5)}\approx1.2332. $$

At this target, \(J(\beta_\rho)=e^{\beta_\rho}=1.5\), while

$$ \Omega(\beta_\rho) =\operatorname{Var}(Y_i-1.5) =\operatorname{Var}(Y_i)=2. $$

Again, the target is not the true parameter \(\log(2)\), and the likelihood information equality does not hold at this distinct target: \(2\ne1.5\). Since \(A=1.5+1.2332=2.7332\), the sandwich variance around the penalized target is approximately \(2/(2.7332^2n)=0.2677/n\). Replacing \(\Omega\) by \(J\) would instead give approximately \(1.5/(2.7332^2n)=0.2008/n\), a different answer. The example shows why the score covariance must be evaluated rather than assumed equal to the Hessian at a penalized target.

Why Ordinary Likelihood Standard Errors and Tests Can Fail

For an unpenalized maximum-likelihood estimator in a correctly specified regular model, the usual information-based covariance is justified by the likelihood score equation, centering at the true parameter, and information equality. Penalization changes these ingredients. The estimator solves a different equation, is generally centered asymptotically at \(\beta_\rho\), and has derivative curvature \(A\), not just \(J\). The random score variation is \(\Omega\). Consequently, simply taking the inverse likelihood Hessian—or adding penalty curvature to that Hessian without accounting for score variation—does not generally produce the covariance in the theorem.

A Wald interval centered at \(\hat\beta_\rho\) and based on a valid sandwich standard error can describe uncertainty around \(\beta_\rho\) under the theorem’s assumptions. It still need not cover \(\beta_0\) at its advertised rate or frequency when the target has nonvanishing bias. A test of a true coefficient also cannot be justified merely by applying the usual maximum-likelihood Wald formula to a penalized coefficient. The estimand, centering, and uncertainty calculation must all match the inferential question.

When the penalty level tends to zero with sample size, classical inference may become available under additional conditions. For a smooth penalty in a fixed-dimensional regular model, the population target’s displacement is often of order \(\rho\) near \(\beta_0\). If that displacement is negligible relative to the \(n^{-1/2}\) sampling scale, and the estimator has the required regularity, the penalty may be asymptotically negligible for inference. This is not automatic: for lasso penalties, tuning selected from the data, or growing-dimensional settings, different arguments and limiting behavior may be required.

Prediction procedures also commonly choose the tuning parameter from the data, for example by cross-validation. The fixed-\(\rho\) derivation above does not include the extra randomness from that choice. Nor does it account for the fact that selected variables may change across samples. Treating a selected set as if it had been specified in advance can understate uncertainty. These cautions do not invalidate penalized prediction; they mean that predictive performance and classical coefficient inference answer different questions.

Common Pitfall

Common mistake: “The likelihood is correctly specified, so I can use the information equality at the fitted penalized coefficient and report the usual model-based standard error.”

Correction: Information equality applies at the true parameter under the usual regularity conditions. A fixed positive penalty may move the target away from that parameter. At a distinct target, calculate \(J(\beta_\rho)\) and \(\Omega(\beta_\rho)\) separately and use the appropriate sandwich covariance for uncertainty around that target. Then address target bias separately if the goal is inference about the true coefficient.

A sound analysis states whether its goal is prediction, inference about a penalized target, or inference about a true model parameter. It reports how tuning was chosen, distinguishes shrinkage bias from sampling variability, and uses an inferential method justified for that goal. A smaller standard error alone does not show that penalization has made coefficient inference more reliable.

Check Your Understanding

Use the distinction between the true parameter, the penalized target, and sampling variation to answer these questions.

  1. Write the population equation defining \(\beta_\rho\), and explain why a nonzero penalty gradient at \(\beta_0\) generally moves the target away from \(\beta_0\).
  2. In the sandwich result, what do \(J\), \(\Omega\), and \(A\) represent? Which one includes the penalty curvature?
  3. Why is information equality not automatically valid at a penalized target distinct from the true parameter?
  4. In the Gaussian ridge example, identify the bias and variance at \(n=100\). Why does a small variance not imply a small mean squared error for the true intercept?
  5. What additional issue arises when the penalty parameter is selected from the same data rather than fixed in advance?
Clinical Biostats