transf_to_unbounded_params#
- luas.jax_convenience_fns.transf_to_unbounded_params(p, param_bounds)[source]#
Replicates the transformation used by
PyMC
andNumPyro
to convert a PyTree of parameters - some or all of which lie within the bounds given byparam_bounds
- to unbounded parameters using the transformation given intransf_to_unbounded
.Used for calculating the Laplace approximation of the posterior with respect to the transformed parameters used by
PyMC
andNumPyro
for sampling.Examples
For a single parameter
p["d"]
which lies between bounds(a, b)
,param_bounds
should be of the form:param_bounds = {"d":[a, b]}
wherea
andb
have the same shape asp["d"]
.- Parameters:
p (PyTree) – All parameters used for log likelihood calculations potentially including additional unbounded parameters.
param_bounds (PyTree) – Contains any bounds for the parameters in
p
.
- Returns:
All parameters in
p
with the unbounded transformed values for any parameter inparam_bounds
. Should match the transformed parameters being sampled byPyMC
andNumPyro
.- Return type:
JAXArray