-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More Advanced Feature Request: Only zero-protect values that need it #36
Comments
If you want to tackle this, that is fine with me. For now I simply want a working model even if it over-protects at first. Once I get that done, I will tackle the more advanced features. |
I thought it would be a later thing (and I thought I'd take it on). |
After thinking about it, this case is actually already parsed. It wouldn't be too much to add, though the general solution will take more. |
Yeah, I wasn't thinking it was terribly hard (but I wasn't sure if I was thinking of everything). |
I might take on the mu-referenced variables and let you take on the general case; depends on who has time first 😄 |
It's a race! |
It now works for me. If you want to check the code or solution see #40 However, it is not totally general. Here is the control stream:
|
You won that race, by far! |
Well it isn't quite complete, I just did the "low hanging fruit" so to speak. Consider the model: one.cmt <- function() {
ini({
tka <- 0.45 ; label("Ka")
tcl <- log(c(0, 2.7, 100)) ; label("Log Cl")
tv <- 3.45; label("log V")
eta.ka ~ 0.6
eta.cl ~ 0.3
eta.v ~ 0.1
add.sd <- 0.7
})
model({
ka <- exp(tka + eta.ka)
cl <- exp(tcl + eta.cl)
v <- exp(tv + eta.v)
b1 <- exp(ka+cl+v)
d/dt(depot) <- -ka * depot
d/dt(central) <- ka * depot - cl/v * central
cp <- central / v
nonsense <- central / b1
cp ~ add(add.sd)
})
} While it is nonsense, it will protect
|
Another part to this (and maybe another low-hanging fruit): do not zero-protect dividing by a number. In a model that I'm testing now, |
I think I saw this. I justified this because |
I just generated a model using the following code, and it unnecessarily zero-protected V in the $DES block. It could have known that V is positive because it's exponentiated in the $PK block.
The generated NONMEM model has the following where the
RXDZ001
protection of V is unnecessary.The text was updated successfully, but these errors were encountered: