bilby.hyper.model.Model
- class bilby.hyper.model.Model(model_functions=None, cache=True)[source]
Bases:
object
Population model that combines a set of factorizable models.
This should take population parameters and return the probability.
\[p(\theta | \Lambda) = \prod_{i} p_{i}(\theta | \Lambda)\]- __init__(model_functions=None, cache=True)[source]
- Parameters:
- model_functions: list
List of callables to compute the probability. If this includes classes, the
__call__
: method should return the probability. The requires variables are chosen at run time based on either inspection or querying avariable_names
attribute.- cache: bool
Whether to cache the value returned by the model functions, default=:code:True. The caching only looks at the parameters not the data, so should be used with caution. The caching also breaks
jax
JIT compilation.
- __call__(*args, **kwargs)
Call self as a function.
Methods
__init__
([model_functions, cache])prob
(data, **kwargs)Compute the total population probability for the provided data given the keyword arguments.
- prob(data, **kwargs)[source]
Compute the total population probability for the provided data given the keyword arguments.
- Parameters:
- data: dict
Dictionary containing the points at which to evaluate the population model.
- kwargs: dict
The population parameters. These cannot include any of
["dataset", "data", "self", "cls"]
unless thevariable_names
attribute is available for the relevant model.