
Declare a non-Gaussian random effect distribution in the model block
Source:R/etaDist.R
rxUdfUiLhs.dist.RdThe model({}) form of ini({})'s dist() line:
Usage
# S3 method for class 'dist'
rxUdfUiLhs(fun, rhs)Value
rxUdfUiLhs() list: the modified iniDf and the inverse-CDF line
that replaces the declaration
Details
Reached through rxUdfUiLhs(), a user-function dispatch on the LEFT of a
model line – dist(eta.cl) is not rxode2 grammar and ~ is already
overloaded, so the UI claims the whole line before rxode2 ever sees it.
The point of the model-block form is that a distribution parameter can be any expression the model has already computed, including one built from covariates:
aCl <- exp(lclm + bWT*(WT - 70))
dist(eta.cl) ~ dgamma(shape = 1/exp(lclrv), rate = 1/(exp(lclrv)*aCl))The ini({}) form cannot express that – it is parsed before the model
block exists, so its arguments can only name population parameters. This
one emits the inverse-CDF line IN PLACE, at the declaration, so everything
above it is in scope.
What it leaves for rxEtaDistExpand() is the part that needs the whole
picture rather than one line: the latent normals, the Gaussian copula that
correlates them, and the rxCor.* thetas. Those are prepended, so the
rxN.* this line reads are defined above it.