Sparse Group Lasso

Efficient implementation of sparse group lasso with optional bound constraints on the coefficients; see . It supports the use of a sparse design matrix as well as returning coefficient estimates in a sparse matrix. Furthermore, it correctly calculates the degrees of freedom to allow for information criteria rather than cross-validation with very large data. Finally, the interface to compiled code avoids unnecessary copies and allows for the use of long integers.


R-CMD-checkCRANstatus

sparsegl sparsegl website

The goal of sparsegl is to fit regularization paths for sparse group-lasso penalized learning problems. The model is typically fit for a sequence of regularization parameters $\lambda$. Such estimators minimize

$$ -\ell(\beta | y,\ \mathbf{X}) + \lambda(1-\alpha)\sum_{g\in G} \lVert\beta_g\rVert_2 + \lambda\alpha \lVert\beta\rVert_1. $$

The main focus of this package is for the case where the loglikelihood corresponds to Gaussian or logistic regression. But we also provide the ability to fit arbitrary GLMs using stats::family() objects. Details may be found in Liang, Cohen, Sólon Heinsfeld, Pestilli, and McDonald (2024).

Installation

You can install the released version of sparsegl from CRAN with:

install.packages("sparsegl")

You can install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("dajmcdon/sparsegl")

Minimal Example

set.seed(1010)
n <- 100
p <- 200
X <- matrix(data = rnorm(n * p, mean = 0, sd = 1), nrow = n, ncol = p)
eps <- rnorm(n, mean = 0, sd = 1)
beta_star <- c(
  rep(5, 5), c(5, -5, 2, 0, 0),
  rep(-5, 5), c(2, -3, 8, 0, 0), rep(0, (p - 20))
)
y <- X %*% beta_star + eps
groups <- rep(1:(p / 5), each = 5)
fit1 <- sparsegl(X, y, group = groups)
plot(fit1, y_axis = "coef", x_axis = "penalty", add_legend = FALSE)

References

Liang, X., Cohen, A., Sólon Heinsfeld, A., Pestilli, F., and McDonald, D.J. 2024. “sparsegl: An R Package for Estimating Sparse Group Lasso.” Journal of Statistical Software 110(6), 1–23. https://doi.org/10.18637/jss.v110.i06.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("sparsegl")

1.1.1 by Daniel J. McDonald, 2 years ago


https://github.com/dajmcdon/sparsegl, https://dajmcdon.github.io/sparsegl/


Report a bug at https://github.com/dajmcdon/sparsegl/issues


Browse source code at https://github.com/cran/sparsegl


Authors: Daniel J. McDonald [aut, cre] , Xiaoxuan Liang [aut] , Anibal Solón Heinsfeld [aut] , Aaron Cohen [aut] , Yi Yang [ctb] , Hui Zou [ctb] , Jerome Friedman [ctb] , Trevor Hastie [ctb] , Rob Tibshirani [ctb] , Balasubramanian Narasimhan [ctb] , Kenneth Tay [ctb] , Noah Simon [ctb] , Junyang Qian [ctb] , James Yang [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, dotCall64, ggplot2, magrittr, Matrix, methods, rlang, RSpectra, tidyr

Suggests dplyr, gglasso, glmnet, knitr, markdown, rmarkdown, splines, testthat


Depended on by absorber.


See at CRAN