transf_from_unbounded_params

transf_from_unbounded_params#

luas.jax_convenience_fns.transf_from_unbounded_params(p_unbounded, param_bounds)[source]#

Inverse of the transformation in transf_to_unbounded_params. Converts parameters being sampled by PyMC and NumPyro to the parameters which lie between bounds described in param_bounds which are used for log likelihood calculations.

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 should lie 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_unbounded (PyTree) – All parameters used for sampling by PyMC and NumPyro to convert for log likelihood calculations which lie in an transformed unbounded space.

  • param_bounds (PyTree) – Contains any bounds for the parameters in p.

Returns:

All parameters used for log likelihood calculations potentially including additional unbounded parameters.

Return type:

JAXArray