Open billdenney opened 3 years ago
I thought that the problem was that I may not have defined a CMT
column (and I do think that is probably part of the issue), so I tried defining an unused CMT
, but that got a zero-byte .bad file. The zero-byte .bad file appears to come up only some of the time, and I don't understand why it is created or not. But regardless, here is a similar test case.
library(nlmixr)
#> detected new version of RxODE, cleaning cache
d_sim <-
data.frame(
concentration=1:1000,
CMT="EFFECT"
)
# Simulate
e0 <- 100
emax <- 100
ec50 <- 200
d_sim$effect_pred <-
e0 + emax*d_sim$concentration/(ec50 + d_sim$concentration)
# Add some exponential and additive error
d_sim$dv <-
d_sim$effect_pred * exp(rnorm(n=nrow(d_sim), sd=0.2)) + rnorm(n=nrow(d_sim))
test_model <- function() {
ini({
e0 <- 100
emax <- 100
ec50 <- log(200)
prop_err <- 0.2
add_err <- 1
})
model({
effect <- e0 + emax*concentration/(exp(ec50) + concentration)
effect ~ prop(prop_err) + add(add_err)
})
}
fit <- nlmixr(object=test_model, data=d_sim, est="focei")
#> Error in RxODE::rxState(rxode): 'names' attribute [22] must be the same length as the vector [21]
Created on 2021-04-27 by the reprex package (v2.0.0)
Perhaps a note that the model requires time or d/dt
at this point may be sufficient to circumvent a strange error.
I think a clear error message that the model requires a time
column would clear it up.
This looks really similar to #502.
Created on 2021-04-27 by the reprex package (v2.0.0)
The nlmixr and RxODE versions were just installed moments ago from GitHub.