Tutorials › Regression Analysis (Undergraduate) › Ridge Shrinkage Along Singular Vectors

Ridge and Lasso Regression · Tutorial 671 of 991

Ridge Shrinkage Along Singular Vectors

Use singular vectors to express ridge regression direction by direction, and see why directions with less predictor information are shrunk more.

Advanced 12 min read

What You'll Learn

  • Express a centered design matrix using its singular value decomposition.
  • Derive ridge coefficient estimates in singular-vector coordinates.
  • Distinguish the shrinkage of coefficients from the shrinkage of fitted values.
  • Explain how each direction’s singular value determines its ridge shrinkage factor.
  • Calculate ridge estimates and compare them with least-squares estimates.
  • Describe the bias–variance tradeoff for estimates along individual directions.

Why Look at Singular Directions?

Ridge regression shrinks coefficients toward zero, but the amount of shrinkage is not the same in every direction through the predictor space. The singular value decomposition (SVD) makes those directions visible. It shows how much variation in the predictors is available along each direction, and therefore how ridge penalization affects that direction.

This view is useful because a coefficient vector combines many directions. A ridge estimate may preserve components well supported by the predictors while reducing components supported by comparatively little predictor information. The shrinkage factors describe that effect precisely.

Model and Notation

Let \(X\) be a centered \(n \times p\) design matrix and \(y\) a centered response vector. Centering means that each predictor column and the response have had their sample mean subtracted. The intercept is therefore handled separately and is not penalized. For the direction-specific calculations below, use the linear model \(y=X\beta+\varepsilon\), with the design matrix treated as fixed and errors satisfying \(E(\varepsilon)=0\) and \(\operatorname{Var}(\varepsilon)=\sigma^2 I\). The ridge estimates themselves are defined by minimizing the penalized sum of squares; normal errors are not needed for the algebra or the variance results below.

Definition: For a tuning parameter \(\lambda>0\), the ridge estimate minimizes \(\|y-X\beta\|^2+\lambda\|\beta\|^2\). The SVD of \(X\) is \(X=UDV^\mathsf{T}\), where the columns of \(U\) and \(V\) are orthonormal singular vectors and the diagonal entries of \(D\) are the singular values. Write the positive singular values as \(d_1,\ldots,d_r\), ordered from largest to smallest, where \(r=\operatorname{rank}(X)\). The corresponding left and right singular vectors are \(u_j\) and \(v_j\).

A singular value measures the size of the design matrix’s action in its corresponding right-singular-vector direction: \(Xv_j=d_j u_j\). Equivalently, \(d_j^2\) is an eigenvalue of \(X^\mathsf{T}X\). A small \(d_j^2\) means that changes in coefficients along \(v_j\) produce relatively little variation in the fitted values. The centered design has no information in any null-space direction \(v\) for which \(Xv=0\).

The penalty depends on predictor scaling. As established in the earlier material on scaling predictors before penalization, comparisons of shrinkage across predictors are most useful when scaling is appropriate to the analysis. Here the SVD describes shrinkage for the centered design matrix as actually entered into the ridge fit.

Deriving the Shrinkage Factors

Use the SVD to express the coefficient vector in right-singular-vector coordinates, \(\beta=\sum_{j=1}^r a_jv_j+\beta_0\), where \(\beta_0\) lies in the null space of \(X\). Also define \(q_j=u_j^\mathsf{T}y\), the response’s coordinate along \(u_j\). Because the singular vectors are orthonormal, the penalized objective separates into a sum of terms, one for each singular direction, plus terms unaffected by the coefficients.

$$ \|y-X\beta\|^2+\lambda\|\beta\|^2 = \|y\|^2-\sum_{j=1}^r 2d_jq_ja_j +\sum_{j=1}^r(d_j^2+\lambda)a_j^2 +\lambda\|\beta_0\|^2. $$

For each \(a_j\), differentiate its quadratic term and set the derivative equal to zero. Since \(d_j^2+\lambda>0\), this gives a unique minimizing coordinate. The null-space term is minimized at \(\beta_0=0\).

$$ \frac{\partial}{\partial a_j} \left[-2d_jq_ja_j+(d_j^2+\lambda)a_j^2\right] =-2d_jq_j+2(d_j^2+\lambda)a_j=0, \qquad \widehat a_{j,\lambda}=\frac{d_jq_j}{d_j^2+\lambda}. $$

When \(\lambda=0\) and \(X\) has full column rank, the least-squares coordinate is \(\widehat a_{j,0}=q_j/d_j\). Thus the ridge coefficient in direction \(v_j\) is the least-squares coefficient multiplied by a direction-specific shrinkage factor.

$$ \widehat a_{j,\lambda} = \underbrace{\frac{d_j^2}{d_j^2+\lambda}}_{\text{coefficient shrinkage factor}} \widehat a_{j,0}. $$
Theorem: In each estimable singular direction \(v_j\), ridge multiplies the least-squares coefficient by \(d_j^2/(d_j^2+\lambda)\). For fixed \(\lambda>0\), this factor is between 0 and 1 and increases as \(d_j^2\) increases. Thus directions with smaller singular values are shrunk more. In the corresponding fitted-value direction \(u_j\), the component \(q_j\) is multiplied by the same factor.

The fitted-value statement follows because \(Xv_j=d_ju_j\): the ridge fit’s coordinate along \(u_j\) is \(d_j\widehat a_{j,\lambda}=d_j^2q_j/(d_j^2+\lambda)\). This distinction matters: the coefficient and fitted value are different quantities, but their shrinkage factors match when each is compared with its least-squares counterpart in the same direction.

For a fixed positive \(\lambda\), the factor approaches 1 as \(d_j^2\) becomes large, and approaches 0 as \(d_j^2\) becomes small. Increasing \(\lambda\) reduces the factor in every direction. If a singular value is exactly zero, the data cannot identify that coefficient direction; ridge sets its null-space coefficient to zero rather than estimating it from the response.

Worked Example: Calculating Shrinkage in Two Directions

Suppose a hypothetical centered design has two singular values, \(d_1=4\) and \(d_2=1\). For a hypothetical centered response, suppose its coordinates are \(q_1=u_1^\mathsf{T}y=6\) and \(q_2=u_2^\mathsf{T}y=2\). Take \(\lambda=3\). These values specify the two directions relevant to the calculation.

In direction 1, the least-squares coefficient is \(q_1/d_1=6/4=1.5\). The shrinkage factor and ridge coefficient are

$$ \frac{d_1^2}{d_1^2+\lambda}=\frac{16}{16+3}=\frac{16}{19}\approx0.8421, \qquad \widehat a_{1,\lambda}=\frac{4(6)}{16+3}=\frac{24}{19}\approx1.263. $$

In direction 2, the least-squares coefficient is \(q_2/d_2=2/1=2\), while the ridge factor and coefficient are

$$ \frac{d_2^2}{d_2^2+\lambda}=\frac{1}{1+3}=0.25, \qquad \widehat a_{2,\lambda}=\frac{1(2)}{1+3}=0.5. $$

The second direction has the smaller singular value and receives the smaller factor. The fitted-value coordinates are \(d_j\widehat a_{j,\lambda}\): they are \(4(24/19)=96/19\approx5.053\) and \(1(0.5)=0.5\), respectively. Equivalently, the original response coordinates \(6\) and \(2\) are multiplied by \(16/19\) and \(0.25\). This calculation concerns the two singular directions; any response component orthogonal to the columns of \(X\) is not fitted.

Reading the Effect of Predictor Information

The shrinkage factor depends on the squared singular value relative to \(\lambda\), not on the singular value alone. In particular, a direction is substantially shrunk when \(d_j^2\) is small compared with \(\lambda\). This comparison gives a practical way to understand the role of the tuning parameter without assigning it an interpretation as a universal amount of shrinkage.

Worked Example: Comparing Strong and Weak Directions

Consider hypothetical squared singular values \(d_1^2=25\) and \(d_2^2=1\), with the same ridge tuning parameter \(\lambda=4\). The shrinkage factors are

$$ \frac{25}{25+4}=\frac{25}{29}\approx0.8621, \qquad \frac{1}{1+4}=0.2000. $$

The direction with \(d_1^2=25\) retains about \(86.21\%\) of its least-squares coefficient, whereas the direction with \(d_2^2=1\) retains \(20.00\%\). The same penalty is applied to both, but their relative information in the design differs. If \(\lambda\) were increased, each factor would decrease; for example, doubling it to 8 gives \(25/33\approx0.7576\) and \(1/9\approx0.1111\). These are factors, not percentages of prediction accuracy or proportions of variance explained.

Why Shrinkage Can Stabilize Estimates

The small singular values also explain why least-squares coefficient estimates can be variable in weak directions. Under the stated fixed-design model, the response coordinate satisfies \(q_j=d_ja_j+u_j^\mathsf{T}\varepsilon\). The error term has variance \(\sigma^2\), because \(u_j\) is a unit vector and \(\operatorname{Var}(\varepsilon)=\sigma^2I\). The least-squares coefficient divides that error by \(d_j\), so its variance is \(\sigma^2/d_j^2\). Ridge instead multiplies the response coordinate by \(d_j/(d_j^2+\lambda)\).

$$ E(\widehat a_{j,\lambda})= \frac{d_j^2}{d_j^2+\lambda}a_j, \qquad \operatorname{Var}(\widehat a_{j,\lambda})= \frac{\sigma^2d_j^2}{(d_j^2+\lambda)^2}. $$

The expectation shows the cost: ridge generally biases the coefficient toward zero. The variance expression shows a potential benefit: compared with least squares, ridge multiplies the variance in that direction by the square of the shrinkage factor. This is a direction-by-direction bias–variance tradeoff, not a guarantee that every ridge fit predicts better.

Worked Example: Comparing Coefficient Variances

Use the hypothetical squared singular values \(1\) and \(25\) from the preceding comparison, set \(\lambda=4\), and suppose the error variance is \(\sigma^2=9\), in squared response units. For the weaker direction, \(d^2=1\), the least-squares coefficient variance is \(9/1=9\). The ridge variance is

$$ \frac{9(1)}{(1+4)^2}=\frac{9}{25}=0.3600. $$

For the stronger direction, \(d^2=25\), the least-squares variance is \(9/25=0.3600\). The ridge variance is

$$ \frac{9(25)}{(25+4)^2}=\frac{225}{841}\approx0.2675. $$

In each direction the ridge-to-least-squares variance ratio equals the square of its shrinkage factor: \(0.2^2=0.0400\) in the weaker direction, and \((25/29)^2\approx0.7432\) in the stronger direction. These calculations describe coefficient variability under the stated error model. They do not show the bias, which also depends on the unknown coefficient \(a_j\), or determine prediction performance by themselves.

Common Mistake and Practical Meaning

A common mistake is to say, “Ridge shrinks every predictor coefficient by the same percentage.” That is generally wrong. Ridge applies a common penalty to the coefficient vector, but in singular-vector coordinates its shrinkage factors are \(d_j^2/(d_j^2+\lambda)\), which vary with the design. These are factors for directions \(v_j\), not necessarily for individual predictors. Each original predictor coefficient can combine contributions from several singular directions.

Another useful caution is that a low singular value identifies a direction of limited predictor information, not automatically a particular variable. The SVD describes combinations of columns of \(X\). The direction-specific result explains how ridge acts on those combinations; it does not by itself identify which named predictor should be removed or establish a causal interpretation.

Key takeaway: For a centered design, ridge retains the fraction \(d_j^2/(d_j^2+\lambda)\) of the least-squares estimate along singular direction \(v_j\). Smaller \(d_j^2\) means less information from the predictors in that direction and, for the same \(\lambda\), stronger shrinkage.

Check Your Understanding

Answer each question using the singular-direction interpretation of ridge regression.

  1. For \(d_j^2=9\) and \(\lambda=3\), what fraction of the least-squares coefficient is retained in direction \(v_j\)?
  2. Two directions have squared singular values 2 and 18. With a common positive \(\lambda\), which direction has the smaller shrinkage factor, and why?
  3. Explain why the fitted-value coordinate along \(u_j\) has the same shrinkage factor as the coefficient coordinate along \(v_j\).
  4. Under the stated error model, how does the variance of a ridge coefficient in one direction compare with the least-squares variance in that direction?
  5. Why is it inaccurate to interpret the singular-direction shrinkage factor as a separate shrinkage percentage for each original predictor?