| mix | R Documentation |
Specify a mixture model of variables
mix(...)
... |
Arguments to the mixture model. The first call to the mixture model function takes an odd number of arguments (at least 3). For example the model we could have: cl = mix(cl1, p1, cl2, p2, cl3) Here there is a mixture of three clearance variables, For simulations this is selected randomly. For estimations this is selected by the data for each individual. After the first call when the number of populations has been established, you can also call the mixture model with the number of populations, for example: v = mix(v1, v2, v3) The ui function will translate this to the following model: v = mix(v1, p1, v2, p2, v3) This is because the first call to |
The mixture model replacement for the underlying rxode2 model.
Matthew L. Fidler
# This is an example of a mixture model
# Where there are 2 different clearance populations
one.cmt <- function() {
ini({
tka <- 0.45 # Log Ka
tcl1 <- log(c(0, 2.7, 100)) # Log Cl
tcl2 <- log(c(0, 0.1, 120)) # Log Cl
tv <- 3.45; label("log V")
p1 <- 0.3
eta.ka ~ 0.6
eta.cl ~ 0.3
eta.v ~ 0.1
add.sd <- 0.7
})
model({
ka <- exp(tka + eta.ka)
# This is the example mixture model
cl <- mix(exp(tcl1 + eta.cl), p1, exp(tcl2 + eta.cl))
v <- exp(tv + eta.v)
me <- mixest # This is the assigned mixture estimate
mn <- mixnum # This is the number of mixture estimate in the model
# This is the uniform mixture estimate used in simualtion to
# determine the population
mu <- mixunif
linCmt() ~ add(add.sd)
})
}
s <- rxSolve(one.cmt, et(amt=320, ii=12, addl=2, cmt=1) |>
et(seq(0, 72)) |>
et(id=1:20))
plot(s, ipredSim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.