pint.models.priors.Prior

class pint.models.priors.Prior(rv)[source]

Bases: object

Class for evaluation of prior probability densities

Any Prior object returns the probability density using the pdf() and logpdf() methods. For generality, these are written so that they work on a scalar value or a numpy array of values.

Parameters:

Examples

A uniform prior of F0, with no bounds (any value is acceptable)

>>> model.F0.prior = Prior(UniformUnboundedRV())

A uniform prior on F0 between 50 and 60 Hz (because num_unit is Hz)

>>> model.F0.prior = Prior(UniformBoundedRV(50.0,60.0))

A Gaussian prior on PB with mean 32 days and std dev 1.0 day

>>> model.PB.prior = Prior(scipy.stats.norm(loc=32.0,scale=1.0))

A bounded gaussian prior that ensure that eccentricity never gets > 1.0

>>> model.ECC.prior = Prior(GaussianBoundedRV(loc=0.9,scale=0.1,
...            lower_bound=0.0,upper_bound=1.0))

Methods

logpdf(value)

pdf(value)