transf_to_unbounded_params

transf_to_unbounded_params#

luas.jax_convenience_fns.transf_to_unbounded_params(p, param_bounds)[source]#

Replicates the transformation used by PyMC and NumPyro to convert a PyTree of parameters - some or all of which lie within the bounds given by param_bounds - to unbounded parameters using the transformation given in transf_to_unbounded.

Used for calculating the Laplace approximation of the posterior with respect to the transformed parameters used by PyMC and NumPyro 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]} where a and b have the same shape as p["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 in param_bounds. Should match the transformed parameters being sampled by PyMC and NumPyro.

Return type:

JAXArray