Construct pharmacometric nonlinear mixed effect models by combining predefined model components and automatically generate model code for NONMEM. Models are created by combining parameter and observation models, algebraic relationships, compartments, and flows. Pharmacokinetic models can be assembled from the higher-order components: absorption, distribution, and elimination. The generated code is optimized for performance by recognizing, for example, linear differential equations or differential equations with an analytic solution.
assemblerr is an R package to construct pharmacometric models by combining pre-defined model components. It’s intended to simplify the specification of complex pharmacometric models and provide a mechanism to generate models in an automatic way. With assemblerr, models are specified using R code and then converted to a NONMEM control stream.
You can install the latest CRAN version assemblerr using:
install.packages("assemblerr")
Load assemblerr
library(assemblerr)
Build a simple model
m <- model() +
input_variable("dose") +
prm_log_normal("emax", median = 10, var_log = 0.09) +
prm_log_normal("ed50", median = 50, var_log = 0.09) +
algebraic(effect~emax*dose/(ed50 + dose)) +
obs_additive(~effect, var_add = 1)
Generate NONMEM code
render(m)
#> $PROBLEM
#> $INPUT DOSE ID DV
#> $DATA data.csv IGNORE=@
#> $PRED
#> EMAX = THETA(1) * EXP(ETA(1))
#> ED50 = THETA(2) * EXP(ETA(2))
#> EFFECT = EMAX * DOSE/(ED50 + DOSE)
#> Y = EFFECT + EPS(1)
#> $ESTIMATION METHOD=COND MAXEVAL=999999
#> $THETA (0, 10, Inf) ; POP_EMAX
#> $THETA (0, 50, Inf) ; POP_ED50
#> $OMEGA 0.09 ; IIV_EMAX
#> $OMEGA 0.09 ; IIV_ED50
#> $SIGMA 1; RUV_ADD
The best place to learn how to use assemblerr is the vignette “Getting
Started”. It provides an overview of the functionality in assemblerr and
helps you building your own models. A simple way to find it is using the
vignette() function in R:
vignette("getting-started", package = "assemblerr")