Skip to content
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

translation of non mu referenced model #101

Open
RichardHooijmaijers opened this issue Feb 12, 2024 · 0 comments
Open

translation of non mu referenced model #101

RichardHooijmaijers opened this issue Feb 12, 2024 · 0 comments

Comments

@RichardHooijmaijers
Copy link

When translating a mu referenced model, everything works perfect. However I have been doing some testing with a model that does not have mu referencing and got an error message that I could not really explain. I have included a reproducible example below. Please let me know if you need some additional information

mumod <- function() {
  ini({
    tka <- 0.45   # Log Ka
    tcl <- -7     # Log Cl
    tv  <- -8     # Log V
    eta.ka ~ 0.6
    eta.cl ~ 0.3
    eta.v ~ 0.1
    prop.sd <- 0.7
  })
  model({
    ka <- exp(tka + eta.ka)
    cl <- exp(tcl + eta.cl)
    v <- exp(tv + eta.v)
    d/dt(depot) = -ka * depot
    d/dt(center) = ka * depot - cl / v * center
    cp = center / v
    cp ~ prop(prop.sd)
  })
}

nonmumod <- function() {
  ini({
    tka <- 0.45   # Log Ka
    tcl <- 0.009     # Log Cl
    tv  <- 0.003     # Log V
    eta.ka ~ 0.6
    eta.cl ~ 0.3
    eta.v ~ 0.1
    prop.sd <- 0.7
  })
  model({
    ka <- tka * exp(eta.ka)
    cl <- tcl * exp(eta.cl)
    v <- tv * exp(eta.v)
    d/dt(depot) = -ka * depot
    d/dt(center) = ka * depot - cl / v * center
    cp = center / v
    cp ~ prop(prop.sd)
  })
}

So this works as expected:

dMod <- nlmixr2data::theo_sd
dMod_nozero <- dMod[(dMod$DV != 0 & dMod$EVID == 0) | (dMod$EVID == 101), ]

modPknca1cmt <-
  nlmixr2(
    mumod,
    data = dMod_nozero, est = "pknca",
    control = pkncaControl(ncaData = dMod, concu = "mg/L", doseu = "mg/kg", timeu = "hr", volumeu = "L/kg")
  )

But got an error with the second model

modPknca1cmt <-
  nlmixr2(
    nonmumod,
    data = dMod_nozero, est = "pknca",
    control = pkncaControl(ncaData = dMod, concu = "mg/L", doseu = "mg/kg", timeu = "hr", volumeu = "L/kg")
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant