Skip to contents

Returns the L1-penalised least squares fit at a single lambda, with intercept and the selected support.

Usage

morie_lasso_path(X, y, lam, iters = 500L, tol = 1e-09)

Arguments

X

Numeric matrix of predictors (without intercept).

y

Numeric response vector.

lam

Non-negative penalty strength.

iters

Maximum coordinate-descent iterations.

tol

Convergence tolerance on the maximum coefficient update.

Value

A list with beta, intercept, support, lambda.

References

Belloni, A. & Chernozhukov, V. (2013).

Examples

set.seed(17)
X <- matrix(rnorm(100 * 4), 100, 4)
y <- 1 + X %*% c(2, 0, 0, -1) + rnorm(100, sd = 0.1)
morie_lasso_path(X, as.numeric(y), lam = 0.1)$support
#> [1] 0 3