Why Ridge Has a Geometric Interpretation
Ridge regression is often introduced by adding a penalty to residual sum of squares. The same fit can be viewed as minimizing residual sum of squares subject to a bound on the size of the coefficient vector. This second view explains why ridge estimates are pulled toward zero and why, unlike a variable-selection method, they are generally not exactly zero.
For clarity, consider a linear regression with \(p\) predictors whose columns and response have been centered. The intercept is therefore handled separately and is not included in the coefficient penalty. Let \(X\) be the \(n\times p\) design matrix, \(y\) the centered response vector, and \(\beta\) the vector of slope coefficients. Assume \(X\) has full column rank. The residual sum of squares is
The full-rank assumption makes the unpenalized least-squares estimate unique and gives the RSS contours their familiar elliptical shape. The intercept is not constrained; if predictors are not centered, the corresponding treatment of an unpenalized intercept must be accounted for before using the slope-only geometry below.
The ball is spherical in the coordinates of the coefficients being penalized. Consequently, predictor scaling matters: changing the units of a predictor changes the numerical scale of its coefficient and can change the geometry. Standardizing predictors before fitting is one way to make coefficient magnitudes more comparable, but it is a modeling choice rather than a requirement of the constrained formulation.
RSS Contours and the Constrained Solution
Write \(H=X^\mathsf{T}X\) and \(z=X^\mathsf{T}y\). Expanding the squared residual gives
For a fixed RSS value, this equation describes a contour in coefficient space. Under the full-rank assumption, \(H\) is positive definite, so contours around the ordinary least-squares estimate are ellipses. The ordinary least-squares estimate is \(\hat{\beta}_{\mathrm{OLS}}=H^{-1}z\), the center of these ellipses, and it gives the smallest RSS without a coefficient constraint.
To find the constrained solution, imagine expanding an RSS contour outward from its minimum until it first touches the feasible ball. If the ordinary least-squares estimate lies inside the ball, the unconstrained minimum is already feasible. If it lies outside, the first contact occurs on the ball’s boundary. At a smooth point of contact, the contour and the sphere have parallel normal directions. Algebraically, their gradients are proportional.
Calculate \(\hat{\beta}_{\mathrm{OLS}}^\mathsf{T}\hat{\beta}_{\mathrm{OLS}}\) and compare it with \(t\).
When \(t\ge \hat{\beta}_{\mathrm{OLS}}^\mathsf{T}\hat{\beta}_{\mathrm{OLS}}\), the constrained solution is \(\hat{\beta}_{\mathrm{OLS}}\).
For \(0<t<\hat{\beta}_{\mathrm{OLS}}^\mathsf{T}\hat{\beta}_{\mathrm{OLS}}\), the solution is obtained using a positive, finite ridge multiplier.
When \(t=0\), the only feasible coefficient vector is \(\beta=0\); this endpoint is not represented by a finite ridge multiplier in general.
Why the Constrained and Penalized Forms Match
For a positive radius, introduce a nonnegative Lagrange multiplier \(\lambda\) for the constraint \(\beta^\mathsf{T}\beta\le t\). The Lagrangian is
Differentiating with respect to \(\beta\) and setting the gradient to zero gives the stationarity equation. Because the gradient of RSS is \(2(H\beta-z)\), this equation is
This is the ridge normal equation for the objective \(\operatorname{RSS}(\beta)+\lambda\beta^\mathsf{T}\beta\). The multiplier is positive when the constraint is active and its positive radius is smaller than the ordinary least-squares coefficient norm. The stationarity equation alone does not determine the radius: the multiplier must also be chosen so that the solution satisfies the active constraint.
The existence statement follows by examining how the norm changes with \(\lambda\). Let \(d_j>0\) be the eigenvalues of \(H\), and express \(z\) in the corresponding orthonormal eigenvector coordinates as \(q_1,\ldots,q_p\). Then the squared norm of the ridge solution is
If \(z\ne0\), at least one \(q_j\) is nonzero. Each nonzero term decreases as \(\lambda\) increases, so the sum decreases strictly and continuously. At \(\lambda=0\), it equals the ordinary least-squares squared norm; as \(\lambda\) tends to infinity, it approaches zero. Therefore, every strictly intermediate positive squared radius is attained at one positive finite multiplier. The multiplier is unique because the norm decreases strictly.
This also explains the usual nonzero-coefficient description of ridge. For finite \(\lambda\), \(H+\lambda I\) is invertible, and its solution is generally not the zero vector when \(z\ne0\). As the radius approaches zero, the corresponding multiplier grows without bound; that limiting behavior does not mean a finite multiplier produces the exact zero solution.
Worked Example: Locating the Solution on a Circular Contour
Suppose a two-predictor regression has \(H=I\), \(z=(3,2)^\mathsf{T}\), and \(y^\mathsf{T}y=16\). Minimize RSS subject to \(\beta^\mathsf{T}\beta\le 13/4\). Find the constrained estimate and its RSS. The method is to compare the ordinary least-squares estimate with the sphere, then use the active-constraint ridge equation.
First, the ordinary least-squares estimate is \(H^{-1}z=(3,2)^\mathsf{T}\). Its squared norm is \(3^2+2^2=13\), which exceeds \(13/4\). Thus the constraint is active and the solution is on the sphere.
Since \(H=I\), the ridge equation is \((1+\lambda)\beta=z\). Try \(\lambda=1\), which gives \(\beta=(3/2,1)^\mathsf{T}\). Its squared norm is \(9/4+1=13/4\), so it satisfies the required boundary exactly.
The RSS is \(16-2z^\mathsf{T}\beta+\beta^\mathsf{T}\beta\). Here \(z^\mathsf{T}\beta=3(3/2)+2(1)=13/2\), and \(\beta^\mathsf{T}\beta=13/4\). Therefore,
The ordinary least-squares RSS is \(16-2(13)+13=3\), smaller than the constrained RSS, as it must be. The estimate is nonzero, but its norm is reduced from \(\sqrt{13}\) to \(\sqrt{13/4}\). The common mistake is to treat the constraint as having no cost to fit; restricting the feasible set cannot improve on the unconstrained minimum.
Ellipses, Directions, and Shrinkage
When \(H\) is not a multiple of the identity matrix, RSS contours are ellipses rather than circles. The ridge solution still lies where an RSS contour first meets the coefficient ball, but the ellipse’s orientation and curvature affect the point of contact. Thus the coefficients need not all shrink by the same proportion in the original predictor coordinates.
Worked Example: An Elliptical RSS Contour
Suppose \(H\) is the diagonal matrix with entries 1 and 4, \(z=(4,8)^\mathsf{T}\), and \(y^\mathsf{T}y=40\). Minimize RSS subject to \(\beta^\mathsf{T}\beta\le 164/25\). Use the ridge equation to identify the solution and check both its norm and RSS.
The ordinary least-squares estimate is \(H^{-1}z=(4,2)^\mathsf{T}\), with squared norm \(16+4=20\). Since \(164/25=6.56<20\), the constraint is active. For \(\lambda=1\), the ridge equation gives
Its squared norm is \(4+64/25=164/25\), so it lies exactly on the specified sphere. To check the fit, calculate \(z^\mathsf{T}\beta=4(2)+8(8/5)=104/5\) and \(\beta^\mathsf{T}H\beta=2^2+4(8/5)^2=356/25\). Therefore,
The ordinary least-squares RSS is \(40-z^\mathsf{T}H^{-1}z=40-32=8\), again lower than the constrained RSS. In the two coordinate directions, the ridge coefficients are respectively \(2/4=1/2\) and \((8/5)/2=4/5\) of their ordinary least-squares values. The unequal shrinkage is consistent with the unequal curvatures of the RSS contour. The common mistake is to assume that a spherical constraint forces equal proportional shrinkage in every original coordinate.
The Zero-Radius Endpoint and an Important Trap
A positive but small sphere and a zero-radius sphere are not interchangeable in the multiplier equation. When \(t=0\), feasibility itself forces \(\beta=0\). At this point the boundary constraint has zero gradient, so the usual smooth-boundary stationarity argument does not supply a finite multiplier for every problem. In particular, if \(z\ne0\), substituting \(\beta=0\) into \((H+\lambda I)\beta=z\) gives \(0=z\), which is impossible for any finite \(\lambda\).
Worked Example: A Zero-Radius Constraint
Let \(H=I\), \(z=(1,0)^\mathsf{T}\), and \(y^\mathsf{T}y=2\). Find the constrained solution and RSS when \(t=0\), and compare with a nearby positive-radius problem with \(t=1/4\).
For \(t=0\), the feasible set contains only \(\beta=(0,0)^\mathsf{T}\). Its RSS is \(2-2(0)+0=2\). The ordinary least-squares estimate is \((1,0)^\mathsf{T}\), so it is not feasible. No finite \(\lambda\) solves the ridge equation at the constrained estimate: \((I+\lambda I)(0,0)^\mathsf{T}=(0,0)^\mathsf{T}\ne(1,0)^\mathsf{T}\).
For the positive radius \(t=1/4\), the ridge equation gives \(\beta=(1/(1+\lambda),0)^\mathsf{T}\). Setting its squared norm equal to \(1/4\) gives \(1/(1+\lambda)=1/2\), so \(\lambda=1\) and \(\beta=(1/2,0)^\mathsf{T}\). Its RSS is \(2-2(1/2)+(1/2)^2=5/4=1.25\). The positive-radius solution has a finite multiplier; the zero-radius solution does not. The common mistake is to claim that every ball excluding ordinary least squares corresponds to a positive finite multiplier. That statement requires \(t>0\).
What the Geometry Does—and Does Not—Say
The geometric view is useful because it separates two questions: which coefficient vectors are allowed, and how well each allowed vector fits the data. Tightening the ball cannot lower the minimum RSS, since it removes candidate coefficient vectors. Increasing the penalty in the penalized formulation likewise pushes the solution toward smaller coefficient norm.
The geometry does not say that ridge sets coefficients exactly to zero, nor that the coefficient sphere is invariant to predictor units. For a nonzero \(z\) and a positive finite multiplier, the ridge estimate is generally nonzero. Also, a sphere in unstandardized coefficients can represent very different practical changes along different predictors. Interpret a ridge fit in the coordinates and scaling actually used to define its penalty.
A final exam trap is to confuse the radius with its square. If the constraint is written \(\beta^\mathsf{T}\beta\le t\), then \(t\) is the squared radius, not the radius itself. The corresponding boundary condition is \(\|\beta\|=\sqrt{t}\). Keeping that distinction explicit avoids incorrect multiplier calculations.
Check Your Understanding
For each problem, identify the geometry or calculation needed and check the final result.
- Let \(H=I\) and \(z=(2,1)^\mathsf{T}\). The coefficient constraint is \(\beta^\mathsf{T}\beta\le1\). Find the ridge multiplier and constrained estimate. (Answer: \(\lambda=\sqrt{5}-1\), \(\hat{\beta}=(2/\sqrt{5},1/\sqrt{5})^\mathsf{T}\).)
- Let \(H\) be diagonal with entries 1 and 3, \(z=(3,6)^\mathsf{T}\), and \(y^\mathsf{T}y=20\). For \(\lambda=1\), find the ridge estimate, its squared norm, and its RSS. (Answer: \(\hat{\beta}=(3/2,3/2)^\mathsf{T}\), squared norm \(9/2\), RSS \(2\).)
- Suppose \(H=I\), \(z=(2,0)^\mathsf{T}\), and the squared-radius bound is \(t=0\). State the constrained estimate and explain whether a finite \(\lambda\) satisfies the ridge normal equation. (Answer: \(\hat{\beta}=(0,0)^\mathsf{T}\); no finite \(\lambda\) satisfies \((I+\lambda I)\hat{\beta}=z\).)
- An ordinary least-squares estimate is \((3,2)^\mathsf{T}\), and the squared-radius bound is 20. Does the constraint change the minimizing coefficient vector? (Answer: No; its squared norm is 13, so it is feasible and remains the constrained minimizer.)
- In an eigenvector coordinate system, suppose \(H\) has eigenvalues 1 and 4 and \(z\) has coordinates \((2,0)^\mathsf{T}\). Find the ridge solution coordinates at \(\lambda=1\), and state which direction shrinks. (Answer: \((1,0)^\mathsf{T}\); the first eigenvector direction shrinks from its ordinary least-squares coordinate 2 to 1, while the second coordinate is zero.)