Problem from nonlinear mixed model

I got an error message when running code: saemix.fit1 <- saemix(saemix.model, saemix.data, saemix.options)
Here is the error message:
Error in optim(par = phi1, fn = conditional.distribution_c, phii = phii, :
function cannot be evaluated at initial parameters

The entire program is:
library(saemix)
saemix.data <- saemixData(name.data = theo.data,
name.group = "ID",
name.predictors = "Time",
name.response = "Concentration")

model1cpt <- function(psi,ID,x) {
D <- 320
t <-x[,1]
ka <-psi[ID,1]
V <-psi[ID,2]
ke <-psi[ID,3]
fpred <-Dka/(V(ka-ke))(exp(-ket)-exp(-ka*t))
return(fpred)
}

saemix.model <- saemixModel(model = model1cpt,
psi0 = c(ka=1,V=20,ke=0.5))

saemix.options <- list(map=TRUE, fim=TRUE, ll.is=FALSE, displayProgress=FALSE, seed=632545)
saemix.fit1 <- saemix(saemix.model, saemix.data, saemix.options)

It is from Nonlinear Mixed Effects Models
Part 3:

3.3 Fitting a NLME model to the theophylline data

data is available here: Theophylline - Data Sets
Appreciate very much if you can help solve the problem, thank you!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.