Why Shrinking a Coefficient Is Not the Same as Removing a Predictor
A ridge model can make a predictor’s coefficient much smaller than its ordinary least-squares value. That reduction may make the fitted model more stable, but it does not, by itself, remove the predictor. For a finite positive penalty, ridge ordinarily leaves each nonconstant predictor in the model with a nonzero coefficient. Understanding that distinction matters when interpreting a fitted model: a small coefficient is not evidence that the fitting method selected the predictor out.
The qualification “ordinarily” is important. A ridge coefficient can be exactly zero for particular data configurations, for example when the relationships among predictors and the response produce an exact cancellation. Ridge does not generally force coefficients to zero as a selection rule. The discussion below uses the usual squared-error ridge objective with an unpenalized intercept, consistent with the earlier material on standardizing predictors and fitting ridge regression.
Ridge Coefficients and the Nonzero Property
Suppose the response is modeled as a linear function of \(p\) predictors. Let \(X\) be the design matrix with its predictor columns centered, let \(y\) be the centered response, and let \(\beta\) be the vector of predictor coefficients. Centering handles the intercept separately; the intercept is not included in the penalty. For a finite \(\lambda>0\), use the objective
This expression is a squared-error fitting objective plus a penalty on the squared coefficient magnitudes. It defines the ridge estimates as the values of \(\beta\) that minimize \(Q(\beta)\). The following equation applies to this objective and this penalty convention; software can use a differently scaled objective, in which case the numerical value assigned to \(\lambda\) may differ.
Differentiate with respect to \(\beta\) and set the gradient equal to zero:
Because \(X^\mathsf{T}X\) is positive semidefinite and \(\lambda>0\), the matrix \(X^\mathsf{T}X+\lambda I\) is positive definite and invertible. Thus the fitted coefficient vector is
This formula explains why ridge usually does not remove predictors. The penalty adds \(\lambda\) to the diagonal of the matrix being inverted; the estimating equation does not impose a requirement that any coordinate of \(\hat{\beta}_{\text{ridge}}\) equal zero. In contrast, a selection method must have a mechanism that can produce exact zeros.
Why Orthogonal Predictors Make the Point Clear
If the centered predictor columns are orthogonal, then \(X^\mathsf{T}X\) is diagonal. Write \(x_j\) for column \(j\) of \(X\). The ridge equation separates into one equation for each coefficient:
The denominator is positive for every \(\lambda>0\). Therefore, if \(x_j^\mathsf{T}y\ne 0\), the ridge coefficient is nonzero for every finite positive \(\lambda\). The coefficient is smaller in magnitude than the corresponding least-squares coefficient, which is \(x_j^\mathsf{T}y/\|x_j\|^2\), but it has not been removed. If \(x_j^\mathsf{T}y=0\), the coefficient is zero; the penalty has not created that zero by thresholding, because the unpenalized association in this orthogonal case was already zero.
With correlated predictors, the coefficient equations are coupled, so the simple one-predictor formula no longer applies. An exact zero can then arise through cancellation. The normal equation for coordinate \(j\) is
If \(\hat{\beta}_{j,\text{ridge}}=0\), the equation requires \(x_j^\mathsf{T}y=\sum_{k\ne j}x_j^\mathsf{T}x_k\hat{\beta}_{k,\text{ridge}}\). This can happen for a particular data set. It is an equality resulting from the data and the other fitted coefficients, not a general ridge rule that discards predictor \(j\).
Worked Example: Shrinkage with Orthogonal Predictors
A hypothetical pricing team fits a centered linear model with two orthogonal, nonconstant predictors. The supplied summaries are \(X^\mathsf{T}X=4I\), \(X^\mathsf{T}y=(8,4)^\mathsf{T}\), and \(\lambda=2\). Find the ordinary least-squares coefficients, the ridge coefficients, and the ridge prediction contribution for a new case with predictor values \((1,-1)\). State whether either predictor is removed.
Method. Use the normal equations for the ordinary least-squares fit and the coordinate formula for orthogonal predictors. The predictors are centered, so these calculations concern slopes; the intercept is handled separately.
For ordinary least squares, the diagonal entries of \(X^\mathsf{T}X\) are both 4. Thus the coefficients are
For ridge, each denominator is \(4+2=6\), so
Both coefficients have been reduced in magnitude, but neither is zero. At predictor values \((1,-1)\), the ridge contribution from the two predictors is
The ordinary least-squares contribution for the same values is \(1(2)+(-1)(1)=1\). The ridge contribution is smaller, but both predictors remain in the fitted expression. Check: multiplying each ridge coefficient by its corresponding diagonal entry plus \(\lambda\) gives \((6\cdot4/3,6\cdot2/3)=(8,4)\), matching \(X^\mathsf{T}y\). The common mistake avoided here is calling a reduced coefficient a removed predictor.
An Exact Zero Can Occur Without Ridge Selecting a Variable
The usual nonzero pattern is not a theorem that every ridge coefficient must always be nonzero. Correlation among columns can make the coordinate equations depend on the other fitted coefficients. The following small fitted example verifies how an exact zero can occur even though ridge has no general zero-setting rule.
Worked Example: A Correlated-Predictor Cancellation
Consider two centered, nonconstant predictors measured on three hypothetical observations:
With an unpenalized intercept and \(\lambda=1\), calculate the ridge coefficients and fitted values. Determine whether the zero coefficient demonstrates variable selection.
Method. Compute the Gram matrix \(X^\mathsf{T}X\) and the response cross-products \(X^\mathsf{T}y\), then solve the ridge normal equations.
The predictor cross-products are \(x_1^\mathsf{T}x_1=2\), \(x_2^\mathsf{T}x_2=2\), and \(x_1^\mathsf{T}x_2=1\). Therefore
The response cross-products are \(x_1^\mathsf{T}y=4/3+5/3=3\) and \(x_2^\mathsf{T}y=4/3-1/3=1\). Adding \(\lambda I\) gives
The vector \((1,0)^\mathsf{T}\) solves this system because the matrix product is \((3,1)^\mathsf{T}\). Hence \(\hat{\beta}_{\text{ridge}}=(1,0)^\mathsf{T}\). The fitted values are \(X\hat{\beta}_{\text{ridge}}=x_1=(1,-1,0)^\mathsf{T}\). The response mean is zero, so the unpenalized intercept is zero.
For comparison, the ordinary least-squares solution is
The zero ridge coefficient results from the particular cross-products and correlation in this example. The normal equation for the second coordinate is satisfied because the association with \(y\) is matched by the contribution from the first predictor: \(x_2^\mathsf{T}y=1=x_2^\mathsf{T}x_1(1)\). Check: the residual is \(y-X\hat{\beta}=(1/3,-2/3,1/3)^\mathsf{T}\), so \(X^\mathsf{T}(y-X\hat{\beta})=(1,0)^\mathsf{T}=\lambda\hat{\beta}\), as required. The common mistake avoided here is treating one exact zero in a particular fit as proof that ridge generally selects variables.
Reading Small Coefficients in a Fitted Model
A coefficient’s magnitude depends on the scale of its predictor. The earlier material on standardizing predictors addresses that comparability issue; it does not change the distinction between shrinkage and selection. Once the fitted coefficient scale is understood, report a small ridge coefficient as small, not as absent. The predictor still contributes to predictions whenever its coefficient is nonzero and its value differs from the model’s centering reference.
A finite positive penalty can make coefficients approach zero as the penalty grows, but an approach toward zero is not the same as reaching zero. In particular, do not round small coefficients to zero and then describe the fitting procedure as having removed the variables. Rounding is a reporting choice, not a property of the fitted ridge model.
Worked Example: Interpreting a Small but Nonzero Coefficient
A hypothetical operations model predicts a centered cost index using three centered, orthogonal predictors. The reported summaries are \(X^\mathsf{T}X=I\), \(X^\mathsf{T}y=(6,0.3,-2)^\mathsf{T}\), an unpenalized intercept of 10, and \(\lambda=0.5\). Find the ridge coefficients and predict the index for a case whose predictor values are \((0.5,-1,0.75)\). Explain how to describe the second predictor.
Method. Because \(X^\mathsf{T}X=I\), each ridge coefficient is its response cross-product divided by \(1+\lambda=1.5\). The prediction adds the intercept to the three coefficient contributions.
The second coefficient is small but not zero. For the specified case, its contribution is \((-1)(0.2)=-0.2\). The other contributions are \((0.5)(4)=2\) and \((0.75)(-4/3)=-1\). Therefore the prediction is
The unpenalized slope vector would be \((6,0.3,-2)^\mathsf{T}\), giving a prediction of \(10+3-0.3-1.5=11.2\). Ridge has shrunk all three slopes, including the second one, but the second predictor has not been removed. Check: multiplying the ridge coefficients by \(1.5\) recovers \((6,0.3,-2)^\mathsf{T}\), the supplied cross-product vector. The common mistake avoided is rounding \(0.2\) to zero or describing it as selected out.
Common Exam Traps
- Calling shrinkage selection. A coefficient smaller than its ordinary least-squares value has been shrunk; it has not been removed unless it is exactly zero.
- Claiming all ridge coefficients are guaranteed nonzero. That is too strong. Exact zeros can occur for particular response and predictor cross-products, especially when predictors are correlated.
- Interpreting a rounded value as the fitted value. If a displayed coefficient rounds to 0.000, inspect its unrounded value before claiming it is exactly zero.
- Including the intercept in the penalty without checking the model definition. The standard setup here leaves the intercept unpenalized and penalizes the predictor coefficients.
For a fitted model, the useful question is not simply whether a coefficient is “small.” Check whether it is exactly zero in the fitted output, understand the scale on which it is expressed, and distinguish the coefficient’s role in prediction from a formal decision to remove a variable. This distinction is aligned with the SOA Exam PA (Predictive Analytics) syllabus.
Check Your Understanding
For each problem, use the stated ridge objective and distinguish small coefficients from exact zeros.
- Two centered orthogonal predictors have squared lengths 5 and 5, with \(X^\mathsf{T}y=(10,-2)^\mathsf{T}\). If \(\lambda=5\), calculate both ridge coefficients. (Answer: \(1\) and \(-0.2\); both predictors have nonzero coefficients.)
- Two centered orthogonal predictors have squared lengths 4 and 9, with \(X^\mathsf{T}y=(2,0)^\mathsf{T}\). If \(\lambda=2\), calculate the ridge coefficients and explain the zero. (Answer: \(1/3\) and \(0\); the second predictor has zero response cross-product in this orthogonal setup.)
- For two centered predictors, \(X^\mathsf{T}X=\begin{pmatrix}3&1\\1&2\end{pmatrix}\), \(X^\mathsf{T}y=(5,4)^\mathsf{T}\), and \(\lambda=1\). Solve for the ridge coefficients. (Answer: \((1,1)^\mathsf{T}\); neither predictor is removed.)
- Three centered orthogonal predictors have \(X^\mathsf{T}X=I\), \(X^\mathsf{T}y=(9,0.05,-3)^\mathsf{T}\), and \(\lambda=2\). Find the ridge coefficients and identify the smallest one. (Answer: \((3,1/60,-1)^\mathsf{T}\); the smallest is \(1/60\), which is nonzero.)
- For two centered predictors, \(X^\mathsf{T}X=\begin{pmatrix}2&1\\1&2\end{pmatrix}\), \(X^\mathsf{T}y=(3,1)^\mathsf{T}\), and \(\lambda=1\). Solve the ridge equations and state what the zero coefficient does—and does not—show. (Answer: \((1,0)^\mathsf{T}\); it shows an exact zero for these data, not that ridge generally performs variable selection.)