gcfit.probabilities.priors.Priors#

class gcfit.probabilities.priors.Priors(priors, model_params, *, logged=True, err_on_fail=False)#

Representation of the prior likelihood functions on various parameters.

Contains the individual prior likelihood functions for each parameter, as a corresponding *Prior object, and handles all interation with them.

Calls to the prior-likelihood should be made to this class, with a given theta, which will be distributed to the relevant parameter-specific functions.

Parameters:
priorsdict

A dictionary describing the prior function for each parameter. Each value should be either one of the _PriorBase subclasses, or a list of [“prior name”, *function args]. Any missing parameters will be filled in with DEFAULT_PRIORS.

model_paramsModelParameters

The ModelParameters instance being used during fitting. This is necessary to determine which parameters are free, and what values to use for any other required (dependant) parameters during computation.

loggedbool, optional

Whether to log the returned likelihoods. Defaults to True.

err_on_failbool, optional

If any called theta parameters return “invalid” priors (i.e. L <= 0), will raise an exception. If False (default), will simply log the failure and continue.

Methods

__init__(priors, model_params, *[, logged, ...])