dynode.infer.sample.sample_then_resolve

dynode.infer.sample.sample_then_resolve#

dynode.infer.sample.sample_then_resolve(parameters: Any, rng_key: Array | None = None, _prefix: str = '') TransmissionParams#

Copy, sample and resolve parameters, returning a jax-compliant copy.

Parameters#

parametersAny

object containing numpyro.Distribution objects to sample and dynode.typing.DeterministicParameter objects to resolve.

rng_keyArray, optional

PRNGKey needed to sample distributions, generated from jax.random.PRNGKey(), by default None meaning context RNGKey will be used if running from within MCMC execution.

_prefixstr, optional

prefix to append to all sampled and resolved parameters. Useful for differentiating between different fits. Changing this parameter may break code that depends on a hardcoded parameter name. Defaults to “”.

Returns#

Any

COPY of the parameters object with all occurences of numpyro.Distribution or DeterministicParameter objects replaced with samples / resolved values.