Skip to contents

Maximises the log-likelihood minus lambda sum |beta_j| with an unpenalised intercept (ESL eq 4.31) by proximal Newton: IRLS quadratic approximations minimised by coordinate descent with soft thresholding. This lambda is N times glmnet's.

Usage

morie_esl_l1_logistic(
  X,
  y,
  lambda,
  max_outer = 200,
  max_inner = 10000,
  tol = 1e-12
)

Arguments

X

Predictors, N by p.

y

0/1 response.

lambda

Penalty, >= 0.

max_outer, max_inner, tol

Iteration controls.

Value

Named list: intercept, beta, active_set (1-based), loglik, objective, score, converged.

References

Friedman, J., Hastie, T. & Tibshirani, R. (2010). JSS 33(1).

Examples

i <- 1:40
X <- cbind(sin(i), cos(3 * i))
morie_esl_l1_logistic(X, as.integer(sin(3 * i) + X[, 1] > 0), 2)$beta
#> [1] 3.551168 0.000000