# Prior module¶

class prior.Prior(array)[source]

Bases: object

Store the type of prior associated to a parameter

It takes as an optional input argument the array of the input parameters defined in the parameter file.

The current implemented types are ‘flat’ (default), and ‘gaussian’, which expect also a mean and sigma. Possible extension would take a ‘external’, needing to read an external file to read for the definition.

The entry ‘prior’ of the dictionary mcmc_parameters will hold an instance of this class. It defines one main function, called draw_from_prior(), that returns a number within the prior volume.

draw_from_prior()[source]

Draw a random point from the prior range considering the prior type

Returns: value (float) – A random sample inside the prior region
value_within_prior_range(value)[source]

Check for a value being in or outside the prior range

is_bound()[source]

Checks whether the allowed parameter range is finite

map_from_unit_interval(value)[source]

Linearly maps a value of the interval [0,1] to the parameter range.

For the sake of speed, assumes the parameter to be bound to a finite range, which should have been previously checked with is_bound()