
Where each declared distribution's arguments are computed in the model
Source:R/etaDist.R
rxUiEtaDistAnchors.RdrxEtaDistExpand() hoists every family argument onto its own model line,
rxEdA.<eta>.<role>, so a declaration's arguments are computed per
observation by the compiled model like any other model quantity – covariates
included, through the ordinary covariate machinery, inside the ODE model
pool. This says which model variable holds each argument, so an estimator
can READ them from the solve instead of evaluating the argument expressions a
second time in its own code.
Arguments
- ui
rxode2 ui, model function, or solve-ready object – the EXPANDED model, since that is what carries the anchor lines
- d
the declarations, as
rxUiEtaDists()returns them (nameandetaDistcolumns). Defaults to reading them offui, which works before the expansion but NOT after:rxEtaDistExpand()removesetaDistfrom theiniDf, so an expanded ui reports no declarations and this would return an empty list. An estimator holds the declarations it stashed before expanding and should pass them.
Value
named list, one character vector per declared random effect, in argument order; empty list when nothing is declared
Details
The order is the declaration's ARGUMENT order, which
rxEtaDistExpand() normalizes at the storage point, so element t lines up
with argument t of the family.
NA means that argument has no anchor: a family whose quantile template
never references it gets no model line for it (a normal-based family
collapses to the latent). An estimator must fall back to its own value
there, and a covariate in such an argument is invisible to the model – so
NA alongside a covariate is a gap, not a value to work around.
Examples
# \donttest{
if (requireNamespace("lotri", quietly = TRUE) &&
"lotriEtaDists" %in% getNamespaceExports("lotri")) {
mod <- function() {
ini({
lclm <- log(5)
lclrv <- log(0.09)
tv <- 3.45
dist(eta.cl) ~ dgamma(shape = 1 / exp(lclrv),
rate = 1 / (exp(lclrv) * exp(lclm)))
add.sd <- 0.7
})
model({
cl <- eta.cl
v <- exp(tv)
linCmt() ~ add(add.sd)
})
}
.d <- rxUiEtaDists(mod)
rxUiEtaDistAnchors(rxEtaDistExpand(mod(), param = "direct"), .d)
}
# }