### Background

**saemix** is an R implementation of the Stochastic Approximation EM algorithm for parameter estimation in (non)linear mixed effects models, which was proposed by Kuhn and Lavielle in 2005 [1].

The SAEM algorithm:

- computes the maximum likelihood estimator of the population parameters, without any approximation of the model (linearization, quadrature approximation, ...), using the Stochastic Approximation Expectation Maximization (SAEM) algorithm,
- provides standard errors for the maximum likelihood estimator,
- estimates the conditional modes, the conditional means and the conditional standard deviations of the individual parameters, using the Hastings-Metropolis algorithm.

Several applications of SAEM in agronomy, animal breeding and PKPD analysis have been published by members of the Monolix group (http://group.monolix.org/). The algorithm has been implemented in the Matlab software as a program called Monolix (http://software.monolix.org/sdoms/software/). **saemix** was programmed in 2011 as an add-on package for the R software [2].

Version 3.0, released in February 2022, extends the original implementation to models that can be described through their log-likelihood, allowing to adjust models to categorical, count or time-to-event data. Major contributors to this version include Belhal Karimi who added the algorithms for discrete data models and developed an algorithm for fast sampling that can be used as an alternative to the SAEM algorithm as a new option [4], Maud Delattre who proposed a BIC-type criterion adapted to non-linear mixed effect models and implemented a selection procedure to select a covariate model [5], and Johannes Ranke who built an interface to saemix in his package mkin [6].

The full PDF documentation for the package including references about the algorithm and examples can be downloaded on the github of the IAME research institute for 'saemix': R software. Documentation is available in the relevant section and includes detailed explanations and examples as to how to use **saemix**.

The current version of **saemix** handles only analytical functions, although ODEs can be implemented using ad hoc codes (at the expense of long runtimes). The following features have not yet been implemented in the R package **saemix**, but are available in the Monolix software:

- categorical covariates with more than 2 categories
- models defined with differential equations (ODE)
- multi-response model
- left censored data
- interoccasion variability
- prior distribution for the random effects
- hidden Markov models
- mixture models
- autocorrelation of the residuals

Although work on **saemix** is ongoing and the package will eventually handle some of these issues, the objective of this R package is not to compete with more complete implementations of SAEM such as Monolix, so that users with very complex models should also consider these other options.

### Main references

[1] Kuhn E, Lavielle M. Maximum likelihood estimation in nonlinear mixed effects models (2005). *Computational Statistics and Data Analysis*, 49: 1020-38.

[2] Comets E, Lavenu A, Lavielle M (2011). saemix: Stochastic Approximation Expectation Maximization (SAEM) algorithm. R package version 1.0.

[3] Comets E, Lavenu A, Lavielle M (2017). Parameter estimation in nonlinear mixed effect models using saemix, an R implementation of the SAEM algorithm. *Journal of Statistical Software*, 80: 1-41.

[4] Delattre M, Lavielle M, Poursat MA (2014). A note on BIC in mixed-effects models. *Electronic Journal of Statistics*, 8:456-75.

[5] Karimi B, Lavielle M, Moulines E (2020). f-SAEM: A fast Stochastic Approximation of the EM algorithm for nonlinear mixed effects models. *Computational Statistics & Data Analysis*, 141:123-38.

[6] Ranke J, Wöltjen J, Schmidt J, Comets E (2021). Taking kinetic evaluations of degradation data to the next level with nonlinear mixed-effects models. * Environments*, 8:71.

See also references in the reference page.

### Contact information

**saemix** is maintained by Emmanuelle Comets (emmanuelle.comets@inserm.fr) Inserm U738, Paris, France and CIC 0203, Rennes, France. Please address any questions, bug notice or suggestions.

### Licence

**saemix** is a software distributed under the terms of the GNU GENERAL PUBLIC LICENSE Version 2, June 1991. The terms of this license are in a file called COPYING found in the library.

### Citations

When using **saemix** in a scientific publication, please use the following citation to reference the software:

Comets E, Lavenu A, Lavielle M (2017). Parameter estimation in nonlinear mixed effect models using saemix, an R implementation of the SAEM algorithm. Journal of Statistical Software, 80: 1-41.