The data predicts mileage (\(\text{mpg}\)) based on two predictors: weight (\(\text{wt}\)) and quarter mile time (\(\text{qsec}\)).
The gray ellipses are the \(\text{RSS}\) contours; they never move, because the
data never changes. The coloured level sets are the penalty. \(\hat\beta(\lambda)\) is where the two meet.
\( \definecolor{lassoc}{RGB}{213,94,0}\definecolor{ridgec}{RGB}{48,112,183}
\hat{\beta}^{\,\text{lasso}}(\lambda) \;=\; \arg\min_{\beta}\;
\text{RSS}(\beta) \;+\; \lambda\,\textcolor{lassoc}{\big(|\beta_1| + |\beta_2|\big)} \)
\( \definecolor{ridgec}{RGB}{48,112,183}
\hat{\beta}^{\,\text{ridge}}(\lambda) \;=\; \arg\min_{\beta}\;
\text{RSS}(\beta) \;+\; \lambda\,\textcolor{ridgec}{\big(\beta_1^2 + \beta_2^2\big)} \)
\( \text{RSS}(\beta) = \frac{1}{n}\sum_{i=1}^{n}
\big(y_i - \beta_1 z_{i1} - \beta_2 z_{i2}\big)^2 \),