The parameterTransform
nimbleFunction is an unspecialized function. Calling parameterTransform(model, nodes)
will generate and return a specialized nimbleFunction, which provides transformation functionality for the specified hierarchical model and set of model nodes. The nodes
argument can represent mutliple model nodes arising from distinct prior distributions, which will be simultaneously transformed according to their respective distributions and constraints.
If the nodes
argument is missing or has length zero, then no nodes will be transformed. A specialized nimbleFunction is created, but will not transform or operate on any model nodes.
The control
argument is a list that supports one additional setting. If control$allowDeterm=FALSE
(the default), deterministic nodes are not allowed in the nodes
argument. If control$allowDeterm=TRUE
, deterministic nodes are allowed and assumed to have no constraints on valid values.
This specialized nimbleFunction has the following methods:
transform
: Transforms a numeric vector of values from the original constrained model scale to a vector of values on the unconstrained scale.
inverseTransform
: Transforms a numeric vector of values from the unconstrained scale to the original constrained parameterization scale.
The unconstrained scale may have different dimensionality from the original constrained scale of the model parameters. For example, a d-dimensional dirichlet distribution is constrained to reside on a simplex in d-dimensional space. In contrast, the corresponding unconstrained parameterization is unrestrained in (d-1) dimensional space. The specialized parameterTransform
nimbleFunction also provides utilities to return the dimensionality of the original (constrained) parameterization, and the transformed (unconstrained) parameterization:
getOriginalLength
: Returns the dimensionality (number of scalar elements) of the original constrained parameterization.
getTransformedLength
: Returns the dimensionality (number of scalar elements) comprising the transformed unconstrained parameterization.
The specialized parameterTransform
nimbleFunction also provides a method for calculating the natural logarithm of the jacobian of the inverse transformation, calculated at any point in the transformed (unconstrained) space:
logDetJacobian
The parameterTransformation
function has no facility for handling discrete-valued parameters.