Inputs are the standard regression setup: n observations, p predictors (typically standardized to zero mean and unit variance), and a response vector y. In macro applications, p ranges from 50 to 500 candidate predictors drawn from financial conditions indices, labor market indicators, survey data, international trade flows, and their lags. The elastic net expects that a moderate-sized subset of these predictors is relevant, possibly in correlated clusters. Unlike LASSO, the analyst does not need to assume that only one predictor per cluster is relevant.
The objective function is minβ2n1∥y−Xβ∥22+λ[α∥β∥1+21−α∥β∥22]. Two hyperparameters govern the fit: the overall penalty strength λ≥0 and the mixing parameter α∈[0,1]. At α=1, the penalty is pure L1 (LASSO). At α=0, the penalty is pure L2 (ridge). Intermediate α values produce models that are sparse (some coefficients exactly zero) but grouping-stable (correlated predictors share selection fate). The L2 component also removes the cap of min(n,p) on the number of selected variables that LASSO imposes: elastic net can select all p predictors if α<1.
Estimation proceeds by coordinate descent (Friedman, Hastie, Tibshirani, 2010). For a fixed (α,λ), the algorithm cycles through predictors and applies a soft-thresholding update that accounts for both penalties. The update for coordinate j is β^j=S(zj,αλ)/(1+λ(1−α)), where zj is the partial residual regression coefficient and S is the soft-thresholding operator. The denominator (1+λ(1−α)) is the ridge contribution: it further shrinks the surviving coefficients beyond what LASSO alone would do. The algorithm is warm-started along a grid of λ values for each α, making the full path computationally cheap. Hyperparameter selection uses two-dimensional k-fold cross-validation over a grid of (α,λ) pairs, or a one-dimensional search over λ at a few fixed α values (0.25, 0.50, 0.75, 1.0) followed by selection of the best (α,λ) pair.