jesterTOV.inference.base.prior.CombinePrior#

class CombinePrior(priors)[source]#

Bases: Prior

A prior class constructed by joining multiple priors together to form a multivariate prior.

Note: This class follows the Jim/jimgw architecture.

This assumes the priors composing the Combine class are independent.

__init__(priors)[source]#
Parameters:

priors (list[Prior]) – List of independent prior distributions to combine.

Methods

__init__(priors)

add_name(x)

Turn an array into a dictionary.

log_prob(z)

Evaluate the log probability by summing over independent priors.

sample(rng_key, n_samples)

Sample from the combined prior by sampling from each component.

Attributes

base_prior

n_dim

parameter_names

composite

base_prior: list[Prior] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=None)#
log_prob(z)[source]#

Evaluate the log probability by summing over independent priors.

Parameters:

z (dict[str, Float]) – Dictionary of parameter names to values.

Return type:

Float

Returns:

log_prob (Float) – The combined log probability.

sample(rng_key, n_samples)[source]#

Sample from the combined prior by sampling from each component.

Parameters:
  • rng_key (PRNGKeyArray) – A random key to use for sampling.

  • n_samples (int) – The number of samples to draw.

Return type:

dict[str, Float[Array, 'n_samples']]

Returns:

samples (dict) – Combined samples from all priors.