nlmixr_trans: nlmixr translation function

Description Usage Author(s) Examples

View source: R/nonmem.R

Description

nlmixr translation function

Usage

1

Author(s)

Richard Hooijmaijers with contributions from Matt Fidler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
f <- function(){
 ini({
 lCl <- 1.6      #log Cl (L/hr)
   lVc <- log(90)  #log Vc (L)
   lKA <- 0.1      #log Ka (1/hr)
   prop.err <- c(0, 0.2, 1)
   add.err <- 1
   #eta.Cl ~ 0.1 ## BSV Cl
   #eta.Vc ~ 0.1 ## BSV Vc
   eta.Cl + eta.Vc ~ c(1,0.01, 1)
   eta.KA ~ fix(0.1) ## BSV Ka
 })
 model({
   ## First parameters are defined in terms of the initial estimates
   ## parameter names.
   Cl <- exp(lCl + eta.Cl)
   Vc <- exp(lVc + eta.Vc)
   KA <- exp(lKA + eta.KA)
   ## After the differential equations are defined
   kel <- Cl / Vc;
   d/dt(depot)  = -KA*depot;
   d/dt(centr)  =  KA*depot-kel*centr;
   ## And the concentration is then calculated
   cp = centr / Vc;
   ## Last, nlmixr is told that the plasma concentration follows
   ## a proportional error (estimated by the parameter prop.err)
   cp ~ prop(prop.err) + add(add.err)
 })
}
# Run the function
nlmixr_trans(f)

nlmixrdevelopment/babelmixr documentation built on March 1, 2021, 10:09 p.m.