I had a model tonight where I wanted to do a post-hoc simulation where I had the parameter estimates in a data.frame. I tried writing a model that could have looked like the following, but the ini() was required.
Is there a reasonable way to make a no-ini() (model()-only) model?
library(nlmixr2)
#> Warning: package 'nlmixr2' was built under R version 4.1.3
#> Loading required package: nlmixr2data
#> Warning: package 'nlmixr2data' was built under R version 4.1.3
pheno <- function() {
model({
ke <- cl / v # elimination rate constant
d/dt(A1) = - ke * A1 # model differential equation
cp = A1 / v # concentration in plasma
cp ~ add(add.err) # define error model
})
}
simdata <-
data.frame(
AMT=c(1, rep(0, 23)),
CMT="A1",
cl=0.008,
v=0.6,
ke=0.008/0.6
)
nlmixr(object=pheno, data=simdata, est="simulate")
#> Error: rxode2 model function requires one 'ini({})' block
I had a model tonight where I wanted to do a post-hoc simulation where I had the parameter estimates in a data.frame. I tried writing a model that could have looked like the following, but the
ini()
was required.Is there a reasonable way to make a no-
ini()
(model()
-only) model?Created on 2022-05-31 by the reprex package (v2.0.1)