SSfol
First-order Compartment Model

Description

Identifies missing first-order compartment models. This is a selfStart function.

Usage

SSfol(Dose, input, lKe, lKa, lCl)

Arguments

Dose a numeric value representing the initial dose.
input a numeric vector at which to evaluate the model. Typically, this value is the time since the start of the experiment.
lKe a numeric parameter representing the natural logarithm of the elimination rate constant.
lKa a numeric parameter representing the natural logarithm of the absorption rate constant.
lCl a numeric parameter representing the natural logarithm of the clearance.

Details

Because this is a selfStart function, it has an attribute called "initial", which is a function that nls can call to compute reasonable starting values for fitting a first-order compartment model to the input data.
Value
returns a numeric vector of the same length as input. It is the value of the expression Dose*exp(lKe+lKa-lCl)*(exp(-exp(lKe)*input) - exp(-exp(lKa)*input))/(exp(lKa) - exp(lKe)). If all of the arguments lKe, lKa, and lCl are the names of objects, the gradient matrix with respect to these names (evaluated at the value of those objects) is attached as an attribute named gradient.
Note
This is primarily intended for use in formulae given to nls function or similar functions.
See Also
nls, selfStart.
Examples
tDat <- data.frame(
  Dose = c(4.02, 4.02, 4.02, 4.02, 4.02, 4.02, 4.02, 4.02, 4.02, 4.02, 4.02),
  Time = c(0., 0.25, 0.57, 1.12, 2.02, 3.82, 5.1, 7.03, 9.05, 12.12, 24.37),
  Conc = c(0.74, 2.84, 6.57, 10.5, 9.66, 8.58, 8.36, 7.47, 6.89, 5.94, 3.28))
nls(Conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data=tDat)
Package stats version 6.1.1-7
Package Index