-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
library(nlmixr2)
#> Loading required package: nlmixr2data
library(tidyverse)
set.seed(42)
rxode2::rxSetSeed(42)
iv1cmt <- function() {
ini({
tV <- 1
tCL <- 0.2
prop.err <- 0.1
})
model({
V <- tV
CL <- tCL
d/dt(X) = -(CL/V)*X
cp = X/V
cp ~ prop(prop.err)
})
}
e <- et(amt=1000, rate=500) %>%
et(0.1, 24, length.out=24)
dat <- rxode2::rxSolve(iv1cmt, e, addDosing = TRUE)
dat <- dat %>%
mutate(ID=1, DV=ifelse(is.na(amt), sim, NA)) %>%
select(ID, evid, cmt, amt, rate, time, DV)
f <- nlmixr(iv1cmt)
fit <- nlmixr(f, dat, est="focei",
control=list(print=0, outerOpt="bobyqa"))
#> rxode2 2.0.12 using 8 threads (see ?getRxThreads)
#> no cache: create with `rxCreateCache()`
#> calculating covariance matrix
#> done
#> → Calculating residuals/tables
#> ✔ done
#> → compress origData in nlmixr2 object, save 2136
#> → compress parHist in nlmixr2 object, save 3088
plot(fit)Created on 2023-03-23 with reprex v2.0.2
Metadata
Metadata
Assignees
Labels
No labels
