Computes the LAR coefficient path. Every active predictor keeps exactly the same absolute correlation with the residual throughout – the equiangularity that distinguishes LAR from forward stepwise, which takes the full least-squares step and destroys it. This is LAR proper, without the lasso modification, so coefficients never leave the active set.
Usage
morie_esl_least_angle_reg(
X,
y,
max_steps = NULL,
standardize = TRUE,
method = c("lar", "lasso")
)Arguments
- X
Predictors, n by p.
- y
Response.
- max_steps
Number of LAR steps; defaults to
min(p, n - 1).- standardize
Scale columns to unit norm first. Correlations are not comparable across differently-scaled predictors, so turning this off makes the entry order depend on the units.
- method
"lar", or "lasso" for the lasso modification (ESL Alg. 3.2a): a coefficient reaching zero leaves the active set, giving the piecewise-linear lasso path as lars(type = "lasso").
Value
List with coef_path (in original units), coef, intercept,
active (1-based entry order), correlations, r_squared.
