Description Usage Arguments Examples
Use Solver for Ordinary Differential Equations (ODE), Switching Automatically Between Stiff and Non-stiff Methods and Generate functions to be used in NLME
1 |
model |
either an R-function that computes the values of the
derivatives in the ODE system (the model definition) at time
t.The return value of |
data |
nlme GroupedData format. |
LogParms |
transform parameters into log scale |
JAC |
A JAC set FALSE. This time we can implement this parts. |
SEQ |
A SEQ set FALSE. |
rtol |
relative error tolerance, either a scalar or an array as
long as |
atol |
absolute error tolerance, either a scalar or an array as
long as |
tcrit |
if not |
hmin |
an optional minimum value of the integration stepsize. In
special situations this parameter may speed up computations with the
cost of precision. Don't use |
hmax |
an optional maximum value of the integration stepsize. If
not specified, |
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 | ####################################################################
#general model from nlmeODE package
#nlmLSODA USE ACCORDING FUNCTIONS
####################################################################
rm(list=ls())
require(insideRODE)
data(Theoph)# examples from nlmeODE
TheophODE <- Theoph
TheophODE$Dose[TheophODE$Time!=0] <- 0
TheophODE$Cmt <- rep(1,dim(TheophODE)[1])
# model files
OneComp <- list(DiffEq=list(
dy1dt = ~ -ka*y1 ,
dy2dt = ~ ka*y1-ke*y2),
ObsEq=list(
c1 = ~ 0,
c2 = ~ y2/CL*ke),
Parms=c("ka","ke","CL"),
States=c("y1","y2"),
Init=list(0,0))
TheophModel <- nlmLSODA(OneComp,TheophODE) #ode solver
Theoph.nlme <- nlme(conc ~ TheophModel(ka,ke,CL,Time,Subject),
data = TheophODE, fixed=ka+ke+CL~1, random = pdDiag(ka+CL~1),
start=c(ka=0.5,ke=-2.5,CL=-3.2),
control=list(returnObject=TRUE,msVerbose=TRUE),
verbose=TRUE)
plot(augPred(Theoph.nlme,level=0:1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.