gravelamps.prior.discrete

Discrete Priors

Implements priors for discrete distributions as needed for the Morse phase which may take one of three distinct values, or the millilensing number of images which must obviously be discrete

Written by Mick Wright

Ania Liu Justin Janquart

Classes

ImageNumber

Discrete Uniform Prior for handling the number of millilensing image signals.

UniformMorse

Discrete Uniform Prior for handling the Morse phase.

Module Contents

class gravelamps.prior.discrete.ImageNumber(ncategories, name='num_images', latex_label='$n_{\\mathrm{signals}}$', unit=None)

Bases: bilby.core.prior.Categorical

Discrete Uniform Prior for handling the number of millilensing image signals.

Lightly modified such that the minimum must be 1

Attributes

ncategoriesint

Number of potential images

namestr

Name of the parameter used, defaults to ‘num_images’

latex_labelstr

The latex compatible output to be used on plots, etc. Defaults to ‘$n_{mathrm{signals}}$’.

unitstr

Unit of the parameter

rescale(val)

Rescale a sample from the unit line element to one of the categories

Parameters:
valUnion[float, int, array_like]

Uniform probability between 0 and 1

Returns:
Union[float, array_like]
cdf(val)

Calculate CDF for sample values

Parameters:
valUnion[float, int, array_like]

Sample values

Returns:
float
class gravelamps.prior.discrete.UniformMorse(name='morse_phase', latex_label='$n$', unit=None)

Bases: bilby.core.prior.Categorical

Discrete Uniform Prior for handling the Morse phase.

This is a restricted subset of the Categorical prior to the cases of 0, 0.5, 1

Attributes:
namestr

Name of the parameter used, defaults to ‘morse_phase’

latex_labelstr

The latex compatible output to be used on plots, etc. Defaults to ‘$n$’

unitstr

Unit of the parameter

Methods

rescale

Maps the continuous distribution 0 to 1 to discrete distribution of 0, 0.5, 1

rescale(val)

Rescale a sample from the unit line element to one of the categories

Parameters:
valUnion[float, int, array_like]

Uniform proabability between 0 and 1

Returns:
Union[float, array_like]
cdf(val)

Calculate CDF for sample values

Parameters:
valUnion[float, int, array_like]

Sample values

Returns:
float