
This selfStart
model evaluates the first-order compartment
function and its gradient. It has an initial
attribute that
creates initial estimates of the parameters lKe
, lKa
,
and lCl
.
SSfol(Dose, input, lKe, lKa, lCl)
a numeric value representing the initial dose.
a numeric vector at which to evaluate the model.
a numeric parameter representing the natural logarithm of the elimination rate constant.
a numeric parameter representing the natural logarithm of the absorption rate constant.
a numeric parameter representing the natural logarithm of the clearance.
a numeric vector of the same length as input
, which 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
names of objects, the gradient matrix with respect to these names is
attached as an attribute named gradient
.
# NOT RUN {
Theoph.1 <- Theoph[ Theoph$Subject == 1, ]
with(Theoph.1, SSfol(Dose, Time, -2.5, 0.5, -3)) # response only
with(Theoph.1, local({ lKe <- -2.5; lKa <- 0.5; lCl <- -3
SSfol(Dose, Time, lKe, lKa, lCl) # response _and_ gradient
}))
getInitial(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Theoph.1)
## Initial values are in fact the converged values
fm1 <- nls(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Theoph.1)
summary(fm1)
# }
Run the code above in your browser using DataLab