Replies: 2 comments
-
Hi @vskantze if this is about Unfortunately without data I cannot really reproduce your issue, but the model seems to work. the library(nlmixr2)
#> Loading required package: nlmixr2data
analytical_model_2 <- function() {
ini({
alpha <- log(0.01)
A = log(100)
w0 <- log(0.005)
g0 <- log(100)
add.err <- 0.1
eta.alpha ~ 0.001
eta.A ~ 0.001
eta.w0 ~ 0.001
eta.g0 ~ 0.001
})
model({
alpha <- exp(alpha + eta.alpha)
omega <- exp(w0 + eta.w0)
A = exp(A + eta.A)
g0 <- exp(g0 + eta.g0)
t_since_dose = max(time - tDose, 0)
gh = exp(-alpha * t_since_dose) * A * sin(omega * t_since_dose) + g0
gh ~ add(add.err)
})
}
analytical_model_2 <- analytical_model_2()
summary(rxode2::rxode2(analytical_model_2$saemModel))
#> → 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
#> rxode2 NA model named rx_890be4b4237babfecac11f024d27cdf3 model (✔ ready).
#> DLL: /tmp/RtmpWHXVwU/rxode2/rx_890be4b4237babfecac11f024d27cdf3__.rxd/rx_890be4b4237babfecac11f024d27cdf3_.so
#> NULL
#>
#> Calculated Variables:
#> [1] "rx_pred_"
#> ── rxode2 Model Syntax ──
#> rxode2({
#> param(alpha, A, w0, g0, eta.g0, tDose)
#> rx_expr_0 ~ t - tDose
#> rx_expr_1 ~ rx_expr_0 > 0
#> rx_pred_ = exp(A - exp(alpha) * (rx_expr_0) * (rx_expr_1)) *
#> sin(exp(w0) * (rx_expr_0) * (rx_expr_1)) + exp(eta.g0 +
#> g0)
#> cmt(gh)
#> dvid(1)
#> }) Created on 2024-09-20 with reprex v2.1.1**** |
Beta Was this translation helpful? Give feedback.
-
I am closing this, for now. I think I will close all issues here and archive this repository, since I think it is causing too much confusion and it hasn't been updated for years. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm trying to use nlmxir2 to fit response data and it works great with the ode model I provided. However, I get an error when I use an analytical solution to the model for faster convergence. I haven't found any help on this subject when providing your own analytical solution instead of the premade ones.
It seems as if RxODE tries to solve the ode system when there isn't one to be solved.
My code:
Beta Was this translation helpful? Give feedback.
All reactions