Skip to content

scale parameter does not apply to endpoint #988

@danieleboaretti

Description

@danieleboaretti
library(nlmixr2)

one.compartment <- function() {
  ini({
    tka <- log(1.57); label("Ka")
    tcl <- log(2.72); label("Cl")
    tv <- log(31.5); label("V")
    eta.ka ~ 0.6
    eta.cl ~ 0.3
    eta.v ~ 0.1
    add.sd <- 0.7
  })
  # and a model block with the error specification and model specification
  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 ~ add(add.sd)
  })
}
scale <- 1
aa <- rxSolve(one.compartment, seed=1, events=theo_sd,
  scale=c(center=scale, cp=scale))
head(aa %>% select(time, center, cp))

scale <- 0.1
aa <- rxSolve(one.compartment, seed=1, events=theo_sd,
  scale=c(center=scale, cp=scale))
head(aa %>% select(time, center, cp))

Hello, I noticed that the scale parameter does not apply to the endpoint cp.
This is the output with scale=1:

  time   center       cp
1 0.00   0.0000 0.000000
2 0.25 128.9277 1.933501
3 0.57 216.7502 3.250556
4 1.12 271.6130 4.073321
5 2.02 276.7748 4.150732
6 3.82 242.2918 3.633598

This is the output with scale=0.1:

  time   center       cp
1 0.00    0.000 0.000000
2 0.25 1289.277 1.933501
3 0.57 2167.502 3.250556
4 1.12 2716.130 4.073321
5 2.02 2767.748 4.150732
6 3.82 2422.918 3.633598

is it intended? I think it would be useful to include the endpoint if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions