Minimises (1/2) RSS + lambda sum |beta_j| over the non-constant columns
(ESL eqs 3.51-3.52) with the exact soft-threshold update; this lambda is n
times glmnet's.
Usage
morie_esl_lasso(X, y, lambda, max_iter = 10000, tol = 1e-12)
Arguments
- X
Design matrix without all-zero columns.
- y
Response.
- lambda
Penalty, >= 0.
- max_iter, tol
Coordinate-descent controls.
Value
Named list: estimate, beta, n_nonzero, active_set (1-based),
objective, iterations, converged, lambda, n, p.
References
Tibshirani, R. (1996). JRSS B 58, 267-288.
Examples
morie_esl_lasso(diag(2), c(3, -1), 0.5)$beta
#> [1] 2.5 -0.5