bilby.core.prior.joint.BaseJointPriorDist

class bilby.core.prior.joint.BaseJointPriorDist(names, bounds=None)[source]

Bases: object

__init__(names, bounds=None)[source]

A class defining JointPriorDist that will be overwritten with child classes defining the joint prior distributions between given parameters,

Parameters:
names: list (required)

A list of the parameter names in the JointPriorDist. The listed parameters must have the same order that they appear in the lists of statistical parameters that may be passed in child class

bounds: list (optional)

A list of bounds on each parameter. The defaults are for bounds at +/- infinity.

__call__(*args, **kwargs)

Call self as a function.

Methods

__init__(names[, bounds])

A class defining JointPriorDist that will be overwritten with child classes defining the joint prior distributions between given parameters,

filled_request()

Check if all requested parameters have been filled.

filled_rescale()

Check if all the rescaled parameters have been filled.

get_instantiation_dict()

ln_prob(value)

Get the log-probability of a sample.

prob(samp)

Get the probability of a sample.

rescale(value, **kwargs)

Rescale from a unit hypercube to JointPriorDist.

reset_request()

Reset the requested parameters to None.

reset_rescale()

Reset the rescaled parameters to None.

reset_sampled()

sample([size])

Draw, and set, a sample from the Dist, accompanying method _sample needs to overwritten

filled_request()[source]

Check if all requested parameters have been filled.

filled_rescale()[source]

Check if all the rescaled parameters have been filled.

ln_prob(value)[source]

Get the log-probability of a sample. For bounded priors the probability will not be properly normalised.

Parameters:
value: array_like

A 1d vector of the sample, or 2d array of sample values with shape NxM, where N is the number of samples and M is the number of parameters.

prob(samp)[source]

Get the probability of a sample. For bounded priors the probability will not be properly normalised.

rescale(value, **kwargs)[source]

Rescale from a unit hypercube to JointPriorDist. Note that no bounds are applied in the rescale function. (child classes need to overwrite accompanying method _rescale().

Parameters:
value: array

A 1d vector sample (one for each parameter) drawn from a uniform distribution between 0 and 1, or a 2d NxM array of samples where N is the number of samples and M is the number of parameters.

kwargs: dict

All keyword args that need to be passed to _rescale method, these keyword args are called in the JointPrior rescale methods for each parameter

Returns:
array:

An vector sample drawn from the multivariate Gaussian distribution.

reset_request()[source]

Reset the requested parameters to None.

reset_rescale()[source]

Reset the rescaled parameters to None.

sample(size=1, **kwargs)[source]

Draw, and set, a sample from the Dist, accompanying method _sample needs to overwritten

Parameters:
size: int

number of samples to generate, defaults to 1