jesterTOV.inference.base.prior.Prior#
- class Prior(parameter_names)[source]#
Bases:
objectBase class for JESTER prior distributions.
Note: This class follows the Jim/jimgw architecture. Should not be used directly since it does not implement any of the real methods.
The rationale behind this is to have a class that can be used to keep track of the names of the parameters and the transforms that are applied to them.
This class was previously inherited from flowMC’s Distribution, but that dependency has been removed to avoid interface conflicts.
Methods
__init__(parameter_names)add_name(x)Turn an array into a dictionary.
log_prob(z)Evaluate the log probability of the prior.
sample(rng_key, n_samples)Sample from the prior distribution.
Attributes
- sample(rng_key, n_samples)[source]#
Sample from the prior distribution.
- Parameters:
rng_key (PRNGKeyArray) – A random key to use for sampling.
n_samples (int) – The number of samples to draw.
- Return type:
- Returns:
samples (dict[str, Float[Array, “ n_samples”]]) – Samples from the distribution. The keys are the names of the parameters.