Introduction
In elastic net regression, lambda controls the strength of the penalty. Holding alpha fixed isolates the effect of changing that strength: the relative mix of the L1 and L2 penalties stays the same, while their combined influence on the fitted coefficients changes. Larger lambda generally means a more constrained fit, but it does not justify every intuitive claim about individual coefficients or the number of selected predictors.
The key distinction is between results that hold for any design matrix and results that require special structure. The training residual sum of squares cannot decrease as lambda increases along globally optimal fits. In an orthogonal design, each coefficient’s absolute value also decreases, until it reaches zero when alpha is positive. With correlated predictors, however, an individual coefficient can increase in magnitude over part of the path.
Objective and the Role of Lambda
Use a fixed design matrix \(X\), response vector \(y\), and coefficient vector \(\beta\). Take the intercept to be unpenalized, and absorb it by centering \(y\) and the predictor columns. For a fixed \(\alpha\) between 0 and 1 and a tuning parameter \(\lambda\geq 0\), the elastic net estimate minimizes the following objective:
Here, \(\|y-X\beta\|_2^2\) is the residual sum of squares (RSS), \(\|\beta\|_1=\sum_j|\beta_j|\), and \(\|\beta\|_2^2=\sum_j\beta_j^2\). At fixed alpha, increasing lambda multiplies the same penalty by a larger amount; it does not change the relative weights of the L1 and L2 parts. The case \(\alpha=0\) is ridge regression, while \(\alpha>0\) includes an L1 penalty and can produce exact zero coefficients.
Unless a special design condition is stated, claims below refer to global minimizers of this objective for the same data and the same alpha. When the minimizer is not unique, the objective-value comparisons still apply to any chosen minimizers.
Orthogonal Design: An Explicit Shrinkage Path
A useful case for seeing how lambda acts is an orthogonal design with centered, scaled predictors satisfying \(X^\mathsf{T}X/n=I\). Define \(z_j=X_j^\mathsf{T}y/n\), where \(X_j\) is column \(j\). The objective separates into one-variable problems, and the solution for coefficient \(j\) is:
When \(|z_j|\leq\lambda\alpha\), the numerator is zero, so the coefficient is zero. Otherwise it keeps the sign of \(z_j\). If \(\alpha>0\), the zero threshold is \(\lambda\geq |z_j|/\alpha\). If \(\alpha=0\), there is no L1 threshold: the ridge coefficient approaches zero as lambda grows but is not set exactly to zero by this formula unless \(z_j=0\).
For a nonzero orthogonal-design coefficient, its magnitude is \[ |\hat\beta_j(\lambda)| = \frac{|z_j|-\lambda\alpha}{1+\lambda(1-\alpha)} \] on the range \(|z_j|>\lambda\alpha\). Differentiating gives:
The derivative applies only while the coefficient is nonzero; after it reaches zero, its magnitude remains zero. It establishes monotone shrinkage in this orthogonal setting, not for every design matrix.
Worked Example: Tracking Three Orthogonal Coefficients
Suppose the predictors satisfy \(X^\mathsf{T}X/n=I\), the unpenalized estimates are \(z=(4,-2,0.4)\), and \(\alpha=0.5\). Compare the fitted coefficients at \(\lambda=0.5\) and \(\lambda=2\). Also compare the part of RSS above the irreducible orthogonal residual component, which is \(n\sum_j(\hat\beta_j-z_j)^2\).
Method. Apply the orthogonal-design threshold and shrinkage formula. At \(\lambda=0.5\), the threshold is \(\lambda\alpha=0.25\) and the denominator is \(1+\lambda(1-\alpha)=1.25\). Thus:
All three coefficients are nonzero. At \(\lambda=2\), the threshold is \(1\) and the denominator is \(2\). The first two coefficients are \((4-1)/2=1.5\) and \(-(2-1)/2=-0.5\). Since \(|0.4|\leq1\), the third coefficient is zero. Therefore \(\hat\beta(2)=(1.5,-0.5,0)\), with two nonzero coefficients instead of three.
At \(\lambda=0.5\), the coefficient differences from \(z\) are \((-1,0.6,-0.28)\), so the scaled residual increment is \(n(1+0.36+0.0784)=1.4384n\). At \(\lambda=2\), the differences are \((-2.5,1.5,-0.4)\), giving \(n(6.25+2.25+0.16)=8.66n\). The larger penalty has reduced the number of active coefficients and moved this fit farther from the unpenalized fit.
Check. Each coefficient has the same sign as its corresponding \(z_j\), and the third coefficient is zero at \(\lambda=2\) because its absolute unpenalized value is below the threshold. The common mistake avoided here is to apply the threshold to the denominator or to compare \(z_j\) with lambda rather than with \(\lambda\alpha\).
What Is Guaranteed for Any Design?
The orthogonal formula is not needed to establish two important general results. Let \(\lambda_1<\lambda_2\), and let \(\hat\beta_1\) and \(\hat\beta_2\) minimize the objective at those respective values of lambda, with alpha and the data fixed. Write \(R_k=R(\hat\beta_k)\) and \(P_k=P_\alpha(\hat\beta_k)\). Optimality at each value gives:
Adding these inequalities yields \((\lambda_2-\lambda_1)(P_2-P_1)\leq0\), so \(P_2\leq P_1\): the value of the combined penalty at the fitted solution cannot increase. The first inequality also gives \(R_1-R_2\leq\lambda_1(P_2-P_1)\leq0\), so \(R_1\leq R_2\). Thus, as lambda increases, the optimized training RSS cannot decrease. This proof compares optimal objective values; it does not require orthogonal predictors.
The penalty is a weighted combination, so its decrease alone does not establish that both \(\|\hat\beta\|_1\) and \(\|\hat\beta\|_2^2\) must separately decrease for every design. Nor does a larger training RSS by itself show that predictive performance on new data worsens; validation data are needed to assess that question.
Worked Example: A Correlated Predictor Can Gain Magnitude
Consider a ridge fit, so \(\alpha=0\), with centered predictors whose normalized Gram matrix is \(X^\mathsf{T}X/n=\begin{pmatrix}1&0.8\\0.8&1\end{pmatrix}\), and suppose \(X^\mathsf{T}y/n=(1,0.9)^\mathsf{T}\). Compare the coefficients at \(\lambda=0\) and \(\lambda=0.1\). The Gram matrix is positive definite because its eigenvalues are \(1.8\) and \(0.2\).
Method. The ridge normal equations are \((X^\mathsf{T}X/n+\lambda I)\hat\beta=X^\mathsf{T}y/n\). For this matrix, the determinant is \(D=(1+\lambda)^2-0.8^2\), and direct inversion gives:
At \(\lambda=0\), \(D=1-0.64=0.36\), so \(\hat\beta_1=0.28/0.36=7/9\) and \(\hat\beta_2=0.1/0.36=5/18\). At \(\lambda=0.1\), \(D=1.1^2-0.64=0.57\), so \(\hat\beta_1=0.38/0.57=2/3\) and \(\hat\beta_2=0.19/0.57=1/3\). The second coefficient increases from \(5/18\), about \(0.2778\), to \(1/3\), even as lambda increases.
Check. The calculation solves the two-variable ridge equations, rather than applying the orthogonal coordinate formula to correlated predictors. The example shows why “every coefficient gets smaller” is not a general theorem: the fitted coefficients adjust jointly to account for predictor correlation. The guarantee is about the combined penalty and training RSS, not every coordinate separately.
Lambda, Model Complexity, and Exam Traps
A larger lambda usually produces a more regularized fit: coefficients are more constrained, and fitted values tend to be less responsive to the observed data. For \(\alpha>0\), exact zeros are possible, so the number of nonzero coefficients is one practical measure of model complexity. But correlated predictors can enter or leave along a path, so this count need not fall at every increase in lambda. When \(\alpha=0\), ridge generally does not set coefficients exactly to zero; counting nonzero coefficients then does not capture its continuous shrinkage.
At sufficiently large lambda, the zero vector is optimal when \(\alpha>0\): at \(\beta=0\), the coordinatewise optimality conditions require each absolute component of \(X^\mathsf{T}y/n\) to be at most \(\lambda\alpha\). If \(\alpha=0\), the L2 penalty instead drives coefficients toward zero as lambda grows, without generally making them exactly zero at a finite value. These statements assume the centered, unpenalized-intercept setup used in the objective above.
A frequent exam error is to take the right conclusion from a derivative but use an incorrect derivative. In the orthogonal case, for \(z_j>0\) while its coefficient is nonzero, \[ \hat\beta_j(\lambda)=\frac{z_j-\lambda\alpha}{1+\lambda(1-\alpha)}. \] The quotient rule gives:
For instance, if \(z_j=4\), \(\alpha=0.5\), and \(\lambda=0.5\), then \(\hat\beta_j=(4-0.25)/1.25=3\). Its derivative is \(-[0.5+0.5(4)]/1.25^2=-2.5/1.5625=-1.6\). The tempting expression \(-z_j/[1+\lambda(1-\alpha)]^2\) would give \(-4/1.5625=-2.56\), which is wrong. The numerator derivative must account for both the changing threshold and the changing denominator.
Check Your Understanding
Use the objective and conditions stated above. Assume orthogonality where a question specifies it.
- For an orthogonal design, \(z_j=2\), \(\alpha=0.5\), and \(\lambda=1\). Calculate the fitted coefficient. (Answer: \(1\))
- For an orthogonal design, \(z_j=1.5\), \(\alpha=0.25\), and \(\lambda=2\). Calculate the fitted coefficient. (Answer: \(0.4\))
- For an orthogonal design, \(z_j=-0.6\), \(\alpha=0.4\), and \(\lambda=1\). Calculate the fitted coefficient and state whether it is zero. (Answer: \(-0.125\); nonzero)
- For an orthogonal design with \(z=(2,0.3)\), \(\alpha=0.5\), compare the number of nonzero coefficients at \(\lambda=0.2\) and \(\lambda=0.8\). (Answer: 2 at \(\lambda=0.2\), and 1 at \(\lambda=0.8\))
- For any fixed design and alpha, if two globally optimal fits use \(\lambda_1<\lambda_2\), can the training RSS at \(\lambda_2\) be smaller? (Answer: No; it cannot decrease as lambda increases.)