Ridge Regression and Directional Shrinkage

Derive how a squared coefficient penalty changes the normal equations and shrink poorly determined feature directions more strongly.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Add a cost on coefficient magnitude
  2. Scaling features changes which solutions are cheap

Add a cost on coefficient magnitude

Ridge minimizes \(\|X\beta-y\|_2^2+\lambda\|\beta\|_2^2\) for \(\lambda>0\), with a separate convention for any intercept. The coefficient matrix in the stationary equations becomes \(X^\top X+\lambda I\). This matrix is positive definite on the penalized coordinates under the usual setup. If a data direction has very small singular value, adding \(\lambda\) prevents that direction from being amplified as strongly as in ordinary inversion.

Scaling features changes which solutions are cheap

For one centered feature with \(\sum_i x_i^2=4\) and \(\sum_i x_iy_i=8\), ordinary least squares gives two. With \(\lambda=4\), ridge gives one. Rescaling the feature changes its penalty for making the same predictions, so choose scale using training data and preserve the fitted transform. Bias and variance give the tradeoff. Lasso uses a different penalty geometry.[1][2]

References

  1. Gareth James et al., An Introduction to Statistical Learning ↩
  2. Trevor Hastie, Robert Tibshirani and Jerome Friedman, The Elements of Statistical Learning ↩