Description Usage Arguments Details RxODE Syntax Author(s) Examples

'nlme_ode' fits a mixed-effect model described using ordinary differential equation (ODEs). The ODE-definition follows RxODE syntax. Specification of fixed effects, random effects and intial values follows the standard nlme notations.

1 2 3 |

`dat.o` |
data to be fitted |

`model` |
a string containing the set of ordinary differential equations (ODE) and other expressions defining the changes in the dynamic system. For details, see the sections “Details” and “ |

`par_model` |
list: model for fixed effects, randoms effects and initial values. |

`par_trans` |
function: calculation of PK parameters |

`response` |
names of the response variable |

`response.scaler` |
optional response variable scaler. default is NULL |

`transit_abs` |
a logical if transit absorption model is enabled |

`atol` |
atol (absolute tolerance for ODE-solver) |

`rtol` |
rtol (relative tolerance for ODE-solver) |

`debugODE` |
a logical if debugging is enabled |

`mc.cores` |
number of cores used in fitting (only for Linux) |

`...` |
additional nlme options |

The ODE-based model specification may be coded inside a character
string or in a text file, see Section *RxODE Syntax* below for
coding details. An internal `RxODE`

compilation manager object
translates the ODE system into C, compiles it, and dynamically loads the
object code into the current R session. The call to `RxODE`

produces an object of class `RxODE`

which consists of a list-like
structure (closure) with various member functions (see Section
*Value* below).

An `RxODE`

model specification consists of one or more
statements terminated by semi-colons, ‘`;`

’, and
optional comments (comments are delimited by `#`

and an
end-of-line marker). **NB:** Comments are not allowed
inside statements.

A block of statements is a set of statements delimited by
curly braces, ‘`{ ... }`

’.
Statements can be either assignments or conditional `if`

statements. Assignment statements can be either “simple”
assignments, where the left hand is an identifier (i.e., variable), or
special “time-derivative” assignments, where the left hand
specifies the change of that variable with respect to time
e.g., `d/dt(depot)`

.

Expressions in assignment and ‘`if`

’ statements can be
numeric or logical (no character expressions are currently supported).
Numeric expressions can include the following numeric operators
(‘`+`

’, ‘`-`

’, ‘`*`

’,
‘`/`

’, ‘`^`

’), and
those mathematical functions defined in the C or the
R math libraries (e.g., `fabs`

, `exp`

, `log`

, `sin`

).
(Note that the modulo operator ‘`%`

’ is currently
not supported.)

Identifiers in an `RxODE`

model specification can refer to:

state variables in the dynamic system (e.g., compartments in a pharmacokinetic/pharmacodynamic model);

implied input variable,

`t`

(time),`podo`

(oral dose, for absorption models), and`tlast`

(last time point);model parameters, (

`ka`

rate of absorption,`CL`

clearance, etc.);others, as created by assignments as part of the model specification.

Identifiers consist of case-sensitive alphanumeric characters,
plus the underscore ‘_’ character. **NB:** the
dot ‘.’ character is **not** a valid character
identifier.

The values of these variables at pre-specified time points are
saved as part of the fitted/integrated/solved model (see
`eventTable`

, in particular its member function
`add.sampling`

that defines a set of time points at which
to capture a snapshot of the system via the values of these variables).

The ODE specification mini-language is parsed with the help of
the open source tool *DParser*, Plevyak (2015).

Wenping Wang

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
## Not run:
library(nlmixr)
ode <- "
d/dt(depot) =-KA*depot;
d/dt(centr) = KA*depot - KE*centr;
"
dat <- read.table(system.file("examples/theo_md.txt", package = "nlmixr"), head=TRUE)
mypar <- function(lKA, lKE, lCL)
{
KA=exp(lKA)
KE=exp(lKE)
CL=exp(lCL)
V = CL/KE
}
specs <- list(fixed=lKA+lKE+lCL~1, random = pdDiag(lKA+lCL~1),
start=c(lKA=0.5, lKE=-2.5, lCL=-3.2))
fit <- nlme_ode(dat, model=ode, par_model=specs, par_trans=mypar,
response="centr", response.scaler="V")
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.