data(Indometh)
TwoComp <- list(DiffEq=list(
dy1dt = ~ -(k12+k10)*y1+k21*y2 ,
dy2dt = ~ -k21*y2 + k12*y1),
ObsEq=list(
c1 = ~ y1,
c2 = ~ 0),
States=c("y1","y2"),
Parms=c("k12","k21","k10","start"),
Init=list("start",0))
IndomethModel <- nlmeODE(TwoComp,Indometh)
#Remove '#' below to run the estimation
#Indometh.nlme <- nlme(conc ~ IndomethModel(k12,k21,k10,start,time,Subject),
# data = Indometh, fixed=k12+k21+k10+start~1, random = pdDiag(start+k12+k10~1),
# start=c(k12=-0.05,k21=-0.15,k10=-0.10,start=0.70),
# control=list(msVerbose=TRUE,tolerance=1e-1,pnlsTol=1e-1,msTol=1e-1),
# verbose=TRUE)
#plot(augPred(Indometh.nlme,level=0:1))
Run the code above in your browser using DataLab