# \donttest{
# Example 1: IV model with pre-defined search space
param_table <- initialize_param_table()
param_table$init[param_table$Name == "lcl"] <- log(0.008)
param_table$init[param_table$Name == "lvc1cmpt"] <- log(0.6)
result <- mod.run(
string = c(1, 0, 0, 0, 0, 0, 0, 0, 0, 1),
dat = pheno_sd,
search.space = "ivbase",
param_table = param_table,
saem.control = nlmixr2est::saemControl(logLik = TRUE,nBurn=200,nEm=300)
)
# Example 2: Oral model with pre-defined search space
param_table <- initialize_param_table()
param_table$init[param_table$Name == "lcl"] <- log(2.72)
param_table$init[param_table$Name == "lvc1cmpt"] <- log(31.5)
result <- mod.run(
string = c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),
dat = theo_sd,
search.space = "oralbase",
param_table = param_table,
saem.control = nlmixr2est::saemControl(logLik = TRUE,nBurn=200,nEm=300)
)
# Example 3: Simplified 1-compartment model with allometric scalling on
# Fix no.cmpt=1 and mcorr=0, vary only CL, Vc, and residual error
param_table <- initialize_param_table()
param_table$init[param_table$Name == "lcl"] <- log(0.008 *((70/3.5)^0.75))
param_table$init[param_table$Name == "lvc1cmpt"] <- log(0.6 *((70/3.5)))
simple_config <- list(
route = "bolus",
params = c("eta.vc", "mcorr", "rv"),
param_dependencies = list(),
fixed_params = list(
no.cmpt = 1,
eta.cl = 1,
allometric_scaling = 1
)
)
dat<-pheno_sd
dat$LOGWT<-log(dat$WT/70)
result <- mod.run(
string = c(1, 1, 1), # Only 3 values needed
dat = dat,
search.space = "custom",
custom_config = simple_config,
param_table = param_table,
saem.control = nlmixr2est::saemControl(logLik = TRUE,nBurn=200,nEm=300)
)
# }
Run the code above in your browser using DataLab