← All STAT 413 applets

Lambda Paths: Ridge vs Lasso

All 10 standardized mtcars predictors, fit by coordinate descent at every \(\lambda\) (computed live, warm-started along the grid). The top panels trace each coefficient \(\hat\beta_j\) as \(\lambda\) grows: ridge shrinks every coefficient smoothly and never to exactly zero; lasso sets coefficients exactly to zero one at a time until none are left. The bottom panel follows two chosen coefficients through \(\beta\)-space: the ridge trajectory bends smoothly toward the origin, while the lasso trajectory hits an axis and travels along it. Drag the \(\lambda\) slider to move the markers.

Penalty
\(\lambda = 0\) is OLS; the top of the slider is just past the \(\lambda\) that kills the last lasso coefficient (ridge coefficients are still nonzero there)
\(\beta\)-space pair

Ridge coefficient paths

\(\lambda\) \(\hat\beta_j\)

Lasso coefficient paths

\(\lambda\) \(\hat\beta_j\)

Two coefficients through \(\beta\)-space