nlmixr is an R package for fitting general dynamic models, pharmacokinetic (PK) models and pharmacokinetic-pharmacodynamic (PKPD) models in particular, with either individual data or population data. The nlme and SAEM estimation routines can be accessed using a universal user interface (UUI), that provides universal model and parameter definition syntax and results in a fit object that can be used as input into the
Xpose package. Running nlmixr using the UUI is described in this vignette.
Under the hood
nlmixr has five main modules:
dynmodel()and its mcmc cousin
dynmodel.mcmc()for nonlinear dynamic models of individual data;
nlme_lin_cmpt()for one to three linear compartment models of population data with first order absorption, or i.v. bolus, or i.v. infusion using the nlme algorithm;
nlme_ode()for general dynamic models defined by ordinary differential equations (ODEs) of population data using the nlme algorithm;
saem_fitfor general dynamic models defined by ordinary differential equations (ODEs) of population data by the Stochastic Approximation Expectation-Maximization (SAEM) algorithm;
gnlmmfor generalized non-linear mixed-models (possibly defined by ordinary differential equations) of population data by the adaptive Gaussian quadrature algorithm.
A few utilities to facilitate population model building are also included in
More examples and the associated data files are available at https://github.com/nlmixrdevelopment/nlmixr/tree/master/vignettes.
We recommend you have a look at
RxODE, the engine upon which
nlmixr depends, as well as
xpose.nlmixr, which provides a link to the seminal nonlinear mixed-effects model diagnostics package
shinyMixR, which provides a means to build a project-centric workflow around nlmixr from the R command line and from a streamlined
shiny front-end application. Members of the nlmixr team also contribute to the
pmxTools packages. For PKPD modeling (with ODE and dosing history) with Stan, check out Yuan Xiong’s package