cogwheel.prior

Abstract prior classes.

Prior is the base class used to define Bayesian priors together with coordinate transformations. There are two sets of coordinates: “sampled” parameters and “standard” parameters. Standard parameters are physically interesting, sampled parameters are chosen to minimize correlations or have convenient priors.

It is possible to define multiple simple priors, each for a small subset of the variables, and combine them with CombinedPrior.

If separate coordinate systems are not desired, a mix-in class IdentityTransformMixin is provided to short-circuit these transforms.

Another mix-in UniformPriorMixin is provided to automatically define uniform priors.

Finally, FixedPrior can be used to fix some parameters to a specific value.

Functions

check_inheritance_order

Check that subclass does not inherit from base2 before base1.

has_compatible_signature

Return whether the signature of func is compatible with passing params.

Classes

CombinedPrior

Make a new Prior subclass combining other Prior subclasses.

FixedPrior

Abstract class to set standard parameters to fixed values.

IdentityTransformMixin

Define standard_params, transform, inverse_transform and ln_jacobian_determinant for priors whose sampled and standard parameters are the same.

Prior

Abstract base class to define priors for Bayesian parameter estimation, together with coordinate transformations from "sampled" parameters to "standard" parameters.

UniformPriorMixin

Define .lnprior for uniform priors.

UnitJacobianMixin

Define .ln_jacobian_determinant for priors with unit Jacobian determinant.

Exceptions

PriorError

Base class for all exceptions in this module.