This function gets a model from the available model library
Arguments
- name
character with the name of the model to load (if
NULL
, lists all available base models)- eta
vector with the parameters to add random effects (sometimes referred to as inter-individual variability, IIV) on
- reserr
The type or types of residual error (currently
"addSd"
,"propSd"
, and"lnormSd"
are accepted)
Examples
modellib(name = "PK_1cmt")
#> function() {
#> description <- "One compartment PK model with linear clearance"
#> ini({
#> lka <- 0.45 ; label("Absorption rate (Ka)")
#> lcl <- 1 ; label("Clearance (CL)")
#> lvc <- 3.45 ; label("Central volume of distribution (V)")
#> propSd <- 0.5 ; label("Proportional residual error (fraction)")
#> })
#> model({
#> ka <- exp(lka)
#> cl <- exp(lcl)
#> vc <- exp(lvc)
#>
#> Cc <- linCmt()
#> Cc ~ prop(propSd)
#> })
#> }
#> <environment: 0x5604e3889180>
modellib(name = "PK_1cmt", eta = c("ka", "vc"), reserr = "addSd")
#>
#>
#>
#>
#> → Adding eta to lka instead of ka due to mu-referencing
#>
#>
#> → Adding eta to lvc instead of vc due to mu-referencing
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> ℹ promote `etalka` to between subject variability with initial estimate 0.1
#> ℹ change initial estimate of `etalka` to `0.1`
#> ℹ promote `etalvc` to between subject variability with initial estimate 0.1
#> ℹ change initial estimate of `etalvc` to `0.1`
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> ! remove population parameter `propSd`
#> ℹ add residual parameter `CcaddSd` and set estimate to 1
#> ℹ change initial estimate of `CcaddSd` to `1`
#> function ()
#> {
#> description <- "One compartment PK model with linear clearance"
#> ini({
#> lka <- 0.45
#> label("Absorption rate (Ka)")
#> lcl <- 1
#> label("Clearance (CL)")
#> lvc <- 3.45
#> label("Central volume of distribution (V)")
#> CcaddSd <- c(0, 1)
#> etalka ~ 0.1
#> etalvc ~ 0.1
#> })
#> model({
#> ka <- exp(lka + etalka)
#> cl <- exp(lcl)
#> vc <- exp(lvc + etalvc)
#> Cc <- linCmt()
#> Cc ~ add(CcaddSd)
#> })
#> }
#> <environment: 0x5604e0cce490>
modellib(name = "PK_1cmt", reserr = "addSd")
#>
#>
#> ! remove population parameter `propSd`
#> ℹ add residual parameter `CcaddSd` and set estimate to 1
#> ℹ change initial estimate of `CcaddSd` to `1`
#> function ()
#> {
#> description <- "One compartment PK model with linear clearance"
#> ini({
#> lka <- 0.45
#> label("Absorption rate (Ka)")
#> lcl <- 1
#> label("Clearance (CL)")
#> lvc <- 3.45
#> label("Central volume of distribution (V)")
#> CcaddSd <- c(0, 1)
#> })
#> model({
#> ka <- exp(lka)
#> cl <- exp(lcl)
#> vc <- exp(lvc)
#> Cc <- linCmt()
#> Cc ~ add(CcaddSd)
#> })
#> }
#> <environment: 0x5604e2dda0e8>