Cookies on Macro by Mark.We use essential cookies for sign-in, locale, and security. With your permission, we also use optional cookies for preferences, for analytics, and for advertising measurement with the Meta (Facebook) Pixel. Read our cookie policy.
Regularized regression that blends LASSO selection with ridge shrinkage for correlated predictor blocks.
Graph workspace
The regularization path plotting coefficients against log- is the canonical elastic net visual. It reveals grouped selection directly: correlated predictors enter and exit together, with their paths running in parallel, unlike LASSO paths where one member of a correlated pair jumps while the other stays flat. The path also shows how the L2 penalty smooths the piecewise-linear kinks of the LASSO path.
Variables selected at the 1-SE penalty
Total count of nonzero coefficients at the penalty chosen on the held-out last third of the sample by the one-standard-error rule. Compare against true active count (8 in the seed) to assess selection accuracy.
10.00
count
Block recovery rate
Fraction of true predictor blocks where at least one member is retained. Measures grouped detection. Ideally 1.0 for the two active blocks.
1.00
proportion
Within-block coefficient spread
Maximum absolute difference in coefficients within the first (stronger) signal block. Smaller spread means the grouped selection property is working. It tends to fall as falls: on the default sample from about 0.32 at to 0.23 at 0.05, and at the presets' 120 observations from about 0.65 at to 0.34 at 0.5.
0.3027
standardized units
Prediction MSE
Mean squared prediction error on the held-out last third of the sample, against the observed outcome, at the chosen penalty. The noise variance is its floor, and it is measured on the same split that chose the penalty, so it is slightly optimistic.
1.55
squared units
L1/L2 mixing: 0.5
How much of the penalty drops variables outright rather than selecting them in groups.
At near 1, paths are piecewise linear with sharp entry points. As decreases, paths smooth out and correlated predictors enter together as parallel traces.
Within-block correlation: 0.8
How closely variables in the same group move together, which sets how strongly groups are picked together.
High makes within-block paths nearly identical (tight parallel bundle). Low makes each predictor's path independent, resembling standard LASSO.
Spread of the random errors; more noise raises the chosen penalty.
More noise pushes the one-standard-error choice toward higher . On this sample both signal blocks survive selection at every noise level on the slider; what grows is the held-out prediction error.
Number of observations; more data allows a lighter penalty and better recovery of the true groups.
More data tends to shift the one-standard-error choice toward lower and bring the active set closer to the true block structure. On this one fixed sample the count of selected variables jumps around as changes, because each draws different data: at the defaults it runs from 8 to 24.
Size of the largest true effect, applied equally across each active group.
Stronger signals separate from zero at higher . The gap between active-block paths and zero-block paths becomes wider.