UniformPrior

class dysmalpy.parameters.UniformPrior[source]

Bases: Prior

Object for flat priors

Methods Summary

log_prior(param, **kwargs)

Returns the log value of the prior given the parameter value

prior_unit_transform(param, u, **kwargs)

Transforms a uniform random variable Uniform[0.,1.] to the prior distribution

sample_prior(param[, N])

Returns a random sample of parameter values distributed according to the prior

Methods Documentation

static log_prior(param, **kwargs)[source]

Returns the log value of the prior given the parameter value

Parameters:

param (DysmalParameter) – DysmalParameter object with which the prior is associated

Returns:

lprior – Log prior value. 0 if the parameter value is within the bounds otherwise -np.inf

Return type:

0 or -np.inf

prior_unit_transform(param, u, **kwargs)[source]

Transforms a uniform random variable Uniform[0.,1.] to the prior distribution

Parameters:
Returns:

v – Transformation of the random uniform variable u to random value(s) drawn from the prior distribution.

Return type:

float or list-like

static sample_prior(param, N=1, **kwargs)[source]

Returns a random sample of parameter values distributed according to the prior

Parameters:
Returns:

rsamp – Random sample of parameter values

Return type:

float or array