SECTION 1
Historical Context & Motivation
The story of regularization in statistical estimation is fundamentally a story about the tension between fitting data well and building models that generalize reliably to unseen observations. Ordinary least squares (OLS) regression, while possessing elegant theoretical properties under classical assumptions, becomes unstable or entirely unusable when predictors are highly correlated or when the number of features rivals or exceeds the sample size. In such settings, the OLS estimator exhibits high variance — small perturbations in the training data produce wildly different coefficient estimates, a hallmark of overfitting. Regularization methods address this pathology by introducing a controlled amount of bias into the estimation process, thereby achieving a more favorable position on the bias–variance tradeoff curve.
The intellectual roots of penalized estimation extend back to the mid-twentieth century, drawing on ideas from numerical analysis, Bayesian inference, and applied statistics. Two penalization strategies have risen to particular prominence: ridge regression (ℓ₂ penalty), which shrinks all coefficients toward zero while retaining every predictor in the model, and lasso regression (ℓ₁ penalty), which can drive some coefficients to exactly zero, performing automatic variable selection. Understanding the historical trajectory of these methods illuminates why they remain indispensable tools in modern high-dimensional statistics.
1943 • Tikhonov Regularization
1970 • Hoerl & Kennard — Ridge Regression
1996 • Tibshirani — The Lasso
2005 • Elastic Net & Modern Extensions
2010s • High-Dimensional Theory Matures
The central question that motivated these developments remains profoundly relevant: when a model has many parameters relative to the available data, how should one constrain the estimation process to obtain predictions that are both accurate and interpretable? Ridge and lasso regularization offer two complementary philosophical answers to this question, and understanding their geometric and algebraic properties is essential for any practitioner working with modern statistical or machine learning models.
SECTION 2
Core Principles & Definitions
At its heart, regularization modifies the standard OLS objective by appending a penalty term that discourages large coefficient values. The general penalized regression objective can be written as the sum of the residual sum of squares and a penalty function of the coefficient vector, scaled by a non-negative tuning parameter λ. The choice of penalty function — whether it penalizes the squared magnitude of coefficients (ℓ₂) or their absolute magnitude (ℓ₁) — determines whether the method is ridge or lasso, and this choice has profound implications for the geometry of the solution and the properties of the resulting estimator.
Bias–Variance Tradeoff
Shrinkage toward Zero
Tuning Parameter λ
Sparsity vs. Dense Solutions
Bayesian Interpretation
KEY TAKEAWAY
SECTION 3
Geometric Interpretation
The most illuminating way to understand the fundamental difference between ridge and lasso is through their constraint region geometry. The penalized objective can equivalently be expressed as a constrained optimization problem: minimize the RSS subject to a norm constraint on the coefficient vector. For ridge, this constraint region is a circle (ℓ₂ ball) in two dimensions, while for lasso it is a diamond (ℓ₁ ball). The shape of the constraint region determines where the elliptical contours of the RSS are most likely to make first contact, and this contact point is the regularized solution.
The geometry reveals the essential distinction. Because the ℓ₁ ball has sharp corners aligned with the coordinate axes, it is far more probable — especially in higher dimensions — that the expanding RSS contour ellipsoid will first touch the constraint region at a vertex where one or more coordinates equal zero. In contrast, the smooth curvature of the ℓ₂ ball means the tangent point almost surely lies in the interior of the coordinate-positive orthant, yielding nonzero estimates for every coefficient. This geometric argument extends naturally to p dimensions: the ℓ₁ ball in ℝᵖ is a cross-polytope whose vertices lie on axes, while the ℓ₂ ball is a hypersphere with no such preferred directions.
SECTION 4
Mathematical Framework
We now formalize the penalized regression objectives. Consider the standard linear model y = Xβ + ε, where X is an n × p design matrix (assumed centered and possibly standardized), y is an n × 1 response vector, β is a p × 1 coefficient vector, and ε ~ N(0, σ²Iₙ). The OLS estimator minimizes ‖y − Xβ‖₂². Regularized estimators augment this with a penalty on β.
RIDGE REGRESSION OBJECTIVE
Here ‖β‖₂² = Σⱼ βⱼ² is the squared ℓ₂ norm. The closed-form solution is β̂_ridge = (XTX + λI)−1XTy. The addition of λI to XTX ensures invertibility even when XTX is singular.
LASSO REGRESSION OBJECTIVE
Here ‖β‖₁ = Σⱼ |βⱼ| is the ℓ₁ norm. There is no closed-form solution; the objective is convex but not differentiable at βⱼ = 0. Solutions are obtained via coordinate descent, LARS, or subgradient methods.
SVD Perspective on Ridge Shrinkage
The singular value decomposition (SVD) X = UDVT provides deep insight into ridge shrinkage. In terms of the SVD, the OLS fitted values are ŷ_OLS = Σⱼ uⱼ(dⱼ²/dⱼ²) uⱼTy, while the ridge fitted values are ŷ_ridge = Σⱼ uⱼ(dⱼ²/(dⱼ² + λ)) uⱼTy. The factor dⱼ²/(dⱼ² + λ) is a shrinkage factor that is close to 1 for large singular values (directions of high variance in X) and close to 0 for small singular values (noisy directions). Ridge thus shrinks the most precisely those components of the solution that are estimated with the least precision.
RIDGE SHRINKAGE FACTORS (SVD FORM)
Each OLS coefficient in the rotated coordinate system (principal component space) is multiplied by the shrinkage factor dⱼ²/(dⱼ² + λ), which lies strictly between 0 and 1 for λ > 0.
LASSO SOFT-THRESHOLDING (UNIVARIATE CASE)
In the orthonormal design case (XTX = I), the lasso solution is the soft-thresholding operator applied to each OLS coefficient independently. Coefficients with |β̂_OLS,j| < λ/2 are set to exactly zero.
SECTION 5
Coefficient Shrinkage Paths & Comparison
A powerful way to visualize the behavior of ridge and lasso is to plot the coefficient path — the trajectory of each βⱼ estimate as λ varies from 0 (OLS solution) to ∞ (all coefficients at zero). For ridge, these paths are smooth curves that decay asymptotically toward zero but never reach it. For lasso, the paths are piecewise linear, and each coefficient hits exactly zero at a finite value of λ. The diagram below illustrates representative coefficient paths for a three-predictor model under both methods.
| Property | Ridge (ℓ₂) | Lasso (ℓ₁) |
|---|---|---|
| Penalty term | λ Σ βⱼ² | λ Σ |βⱼ| |
| Constraint geometry | Hypersphere (smooth) | Cross-polytope (corners) |
| Closed-form solution | Yes: (XTX + λI)⁻¹XTy | No (requires iterative algorithms) |
| Sparsity | Never — all coefficients remain nonzero | Yes — some coefficients set to exactly zero |
| Correlated predictors | Shrinks correlated predictors together | Tends to select one and discard others |
| Bayesian prior | Gaussian: βⱼ ~ N(0, σ²/λ) | Laplace: βⱼ ~ Laplace(0, 1/λ) |
| Coefficient path | Smooth, asymptotic to zero | Piecewise linear, reaches zero at finite λ |
Key differences between ridge and lasso regularization
SECTION 6
Worked Example: Ridge and Lasso on a Simple Dataset
Consider a simple regression problem with n = 4 observations and p = 2 standardized predictors. Suppose that XTX = [[5, 4], [4, 5]] and XTy = [7, 3]. We will compute both the OLS and ridge estimates with λ = 2, then discuss the lasso solution qualitatively.
Ridge Regression with λ = 2
- 1
Step 1 — Compute OLS Estimate
The OLS solution solves (XTX)β = XTy. We compute (XTX)⁻¹ = (1/(25−16))[[5,−4],[−4,5]] = (1/9)[[5,−4],[−4,5]]. Then β̂_OLS = (1/9)[[5,−4],[−4,5]] × [7,3] = (1/9)[35−12, −28+15] = (1/9)[23, −13].β̂_OLS = (2.556, −1.444) - 2
Step 2 — Form Penalized Matrix ( + λI)
For λ = 2, add 2I to XTX: [[5+2, 4],[4, 5+2]] = [[7, 4],[4, 7]]. The determinant is 49 − 16 = 33.XTX + λI = [[7, 4], [4, 7]], det = 33 - 3
Step 3 — Compute Ridge Estimate
Invert and multiply: β̂_ridge = (1/33)[[7,−4],[−4,7]] × [7,3] = (1/33)[49−12, −28+21] = (1/33)[37, −7].β̂_ridge = (1.121, −0.212) - 4
Step 4 — Analyze Shrinkage
Comparing estimates: β₁ shrank from 2.556 to 1.121 (56% reduction), and β₂ shrank from −1.444 to −0.212 (85% reduction). Both coefficients moved substantially toward zero, with the smaller coefficient (β₂) experiencing proportionally greater shrinkage. Crucially, neither coefficient is exactly zero — this is characteristic of ridge.Shrinkage: β₁ reduced 56%, β₂ reduced 85% — both nonzero - 5
Step 5 — Lasso Comparison (Qualitative)
For lasso with a comparable penalty, the soft-thresholding nature of ℓ₁ would likely set β₂ to exactly zero (since its OLS magnitude is smaller), leaving only β₁ in the model. Numerical coordinate descent would yield approximately β̂_lasso ≈ (1.5, 0) for an appropriately chosen λ, producing a genuinely sparse model.Lasso: β̂ ≈ (1.5, 0) — β₂ eliminated
SECTION 7
Strengths, Limitations, and When to Use Each
Neither ridge nor lasso is universally superior; each excels in different data environments. Choosing between them — or combining them via the elastic net — depends on the underlying structure of the data-generating process, the goals of the analysis (prediction vs. interpretation), and practical considerations such as computational cost and the number of predictors relative to observations.
| Criterion | Ridge Strengths / Limitations | Lasso Strengths / Limitations |
|---|---|---|
| When many predictors are relevant | Strength: retains all predictors, distributes shrinkage evenly | Limitation: may discard useful predictors arbitrarily |
| When true model is sparse | Limitation: cannot zero out irrelevant predictors | Strength: automatic variable selection produces interpretable models |
| Multicollinearity | Strength: handles correlated predictors gracefully by shrinking together | Limitation: arbitrarily selects one predictor from correlated group |
| p > n settings | Applicable; solution always exists and is unique | Applicable; selects at most n predictors |
| Computation | Efficient: closed-form matrix solution | Requires iterative algorithms (coordinate descent) |
| Interpretability | All predictors present; harder to interpret | Sparse models; easier to communicate results |
Comparative strengths and limitations of ridge versus lasso regularization
WHEN TO USE WHICH
SECTION 8
Connections to Advanced Theory
Ridge and lasso are foundational members of a larger family of penalized estimators that have become central to modern high-dimensional statistics. Understanding their theoretical properties opens the door to more advanced topics including the elastic net, group lasso, adaptive lasso, and SCAD/MCP (non-convex) penalties. The theoretical landscape also encompasses oracle properties, restricted eigenvalue conditions, and connections to compressed sensing.
| Concept | Ridge / Lasso (This Lesson) | Advanced Extension |
|---|---|---|
| Penalty function | ℓ₁ or ℓ₂ penalty separately | Elastic net: α‖β‖₁ + (1−α)‖β‖₂², bridging ridge and lasso |
| Variable selection consistency | Standard lasso: not always oracle consistent | Adaptive lasso with data-driven weights achieves oracle property |
| Grouped predictors | Lasso selects one from a correlated group | Group lasso enforces all-in or all-out selection within groups |
| Bias properties | Both introduce non-negligible bias for large signals | SCAD/MCP: non-convex penalties that reduce bias for large coefficients |
| Bayesian framework | Gaussian or Laplace priors on β | Spike-and-slab priors, horseshoe priors for more principled shrinkage |
From introductory to advanced regularization concepts
Looking Ahead
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Summary & Review
Summary
Ridge regression and lasso regression are penalized estimation methods that modify the OLS objective by adding a constraint on the coefficient vector. Ridge uses an ℓ₂ (squared norm) penalty, which shrinks all coefficients proportionally toward zero while retaining every predictor, yielding a closed-form solution via ( + λI)⁻¹X^Ty. Lasso uses an ℓ₁ (absolute value) penalty, whose diamond-shaped constraint region causes the solution to lie at corners of the polytope, setting some coefficients to exactly zero and thereby performing automatic variable selection.
The tuning parameter λ controls the strength of regularization, interpolating between OLS (λ = 0) and full shrinkage (λ → ∞), and is typically selected via cross-validation. From a Bayesian perspective, ridge corresponds to a Gaussian prior on β and lasso to a Laplace prior. Ridge excels when many predictors carry small signals and multicollinearity is present; lasso excels when the true model is sparse. The elastic net combines both penalties for situations where neither pure approach is optimal, and extensions such as the adaptive lasso achieve oracle consistency under weaker conditions than the standard lasso.