EM Algorithm for Lasso-Penalized Linear Mixed Models

Fits linear mixed models with a lasso penalty on the fixed-effects coefficients via an Expectation-Maximization (EM) algorithm. Random effects are treated as missing data at each E-step and the fixed-effects update is solved with a coordinate-descent lasso ('glmnet'), so the same penalized-likelihood machinery used for ordinary linear models extends naturally to clustered/longitudinal data. By default, EMLMLasso() fits the model over a data-driven grid of penalty values and selects the tuning parameter by Bayesian Information Criterion. This is a modification of the method of Oliveira, Schumacher, and Lachos (2026) , in which the tuning parameter is re-selected by cross-validation at every EM iteration.


EMLMLasso

An R package for fitting linear mixed models with a lasso penalty on the fixed effects, for clustered/longitudinal data, via an EM algorithm.

Installation

# from GitHub
# install.packages("remotes")
remotes::install_github("fernandalschumacher/EMLMLasso", build_vignettes = TRUE)

Usage

library(EMLMLasso)

dat <- simulate_lasso_lmm(n = 40, nj = 5, p = 10, pstar = 3, seed = 2026)
fixedForm <- as.formula(paste("y ~", paste0("x", 1:10, collapse = " + ")))

# select lambda by BIC over a data-driven grid (the default, and the
# recommended way to call this for most uses)
search <- EMLMLasso(dat, formFixed = fixedForm, groupVar = "id", formRandom = ~time)
search
coef(search)
plot(search)

# or fit a single lambda directly, by passing one in
fit <- EMLMLasso(dat, formFixed = fixedForm, groupVar = "id", formRandom = ~time,
                  lambda = 0.15)

See vignette("EMLMLasso-intro") for a full walkthrough, and NEWS.md for what changed from the earlier development scripts.

Citation

This package implements the EMLMLasso algorithm of Oliveira, Schumacher and Lachos (2026) with modifications. Most notably, the penalty λ is selected by BIC over a grid of candidate values, with λ held fixed within each EM fit, instead of being re-selected by cross-validation at every EM iteration as in Algorithm 1 of the paper. Convergence is also assessed on the change in parameter estimates rather than on the relative change in the penalized log-likelihood. Results may therefore differ from those reported in the paper.

The original method is described in:

Oliveira DCR, Schumacher FL, Lachos VH (2026). The use of the EM algorithm for regularization problems in high-dimensional linear mixed-effects models. Statistical Methods in Medical Research, 35(2), 240-254. doi:10.1177/09622802251399913

Run citation("EMLMLasso") for a BibTeX-ready entry.

Acknowledgments

Portions of this package's documentation were drafted with the assistance of Claude (Anthropic).

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("EMLMLasso")

0.1.0 by Fernanda Lang Schumacher, a day ago


https://github.com/fernandalschumacher/EMLMLasso


Report a bug at https://github.com/fernandalschumacher/EMLMLasso/issues


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


Authors: Fernanda Lang Schumacher [aut, cre] , Daniela C.R. Oliveira [aut] , Victor H. Lachos [aut] , Marcos Santos de Oliveira [aut]


Documentation:   PDF Manual  


GPL-3 license


Imports glmnet, graphics, mvtnorm, stats, utils

Suggests testthat, knitr, rmarkdown, lme4


See at CRAN