You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(nlmixr2)
#> Loading required package: nlmixr2data
library(xpose)
#> Error in library(xpose): there is no package called 'xpose'
library(xpose.nlmixr2)
#> Error in library(xpose.nlmixr2): there is no package called 'xpose.nlmixr2'
library(ggplot2)
nimo<-function() {
ini({
## Note that the UI can take expressions## Also note that these initial estimates should be provided on the log-scaletcl<- log(0.001)
tv1<- log(1.45)
tQ<- log(0.004)
tv2<- log(44)
tkss<- log(12)
tkint<- log(0.3)
tksyn<- log(1)
tkdeg<- log(7)
## Initial estimates should be high for SAEM ETAseta.cl~2eta.v1~2eta.kss~2## Also true for additive error (also ignored in SAEM)add.err<-10
})
model({
cl<- exp(tcl+eta.cl)
v1<- exp(tv1+eta.v1)
Q<- exp(tQ)
v2<- exp(tv2)
kss<- exp(tkss+eta.kss)
kint<- exp(tkint)
ksyn<- exp(tksyn)
kdeg<- exp(tkdeg)
k<-cl/v1k12<-Q/v1k21<-Q/v2
eff(0) <-ksyn/kdeg##initializing compartment## Concentration is calculatedconc=0.5*(central/v1-eff-kss)+0.5*sqrt((central/v1-eff-kss)**2+4*kss*central/v1)
d/dt(central) =-(k+k12)*conc*v1+k21*peripheral-kint*eff*conc*v1/(kss+conc)
d/dt(peripheral) =k12*conc*v1-k21*peripheral##Free Drug second compartment amountd/dt(eff) =ksyn-kdeg*eff- (kint-kdeg)*conc*eff/(kss+conc)
IPRED=log(conc)
IPRED~ add(add.err)
})
}
fit<- nlmixr(nimo, nimoData, est="saem", control=saemControl(print=0))
#> → loading into symengine environment...#> → pruning branches (`if`/`else`) of saem model...#> ✔ done#> → finding duplicate expressions in saem model...#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> → optimizing duplicate expressions in saem model...#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> ✔ done#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’#> rxode2 2.1.2 using 8 threads (see ?getRxThreads)#> no cache: create with `rxCreateCache()`#> Calculating covariance matrix#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> → loading into symengine environment...#> → pruning branches (`if`/`else`) of saem model...#> ✔ done#> → finding duplicate expressions in saem predOnly model 0...#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> → finding duplicate expressions in saem predOnly model 1...#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> → optimizing duplicate expressions in saem predOnly model 1...#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> → finding duplicate expressions in saem predOnly model 2...#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> → optimizing duplicate expressions in saem predOnly model 2...#> [====|====|====|====|====|====|====|====|====|====] 0:00:00#> ✔ done#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’#> → Calculating residuals/tables#> ✔ done#> → compress origData in nlmixr2 object, save 26920#> → compress phiM in nlmixr2 object, save 207080#> → compress parHistData in nlmixr2 object, save 19928#> → compress saem0 in nlmixr2 object, save 14176nimo_sim<- rxSolve(fit, nimoData)
#> Error in exists("meta", envir = ui): invalid 'envir' argument
This seems to be an edge case; It doesn't follow a simple pattern
See
nlmixr2/rxode2#661
But this still reproduces the error:
Created on 2024-03-07 with reprex v2.1.0
Session info
Originally posted by @mattfidler in nlmixr2/nlmixr2#208 (reply in thread)
The text was updated successfully, but these errors were encountered: