BoundedGaussianPrior
- class dysmalpy.parameters.BoundedGaussianPrior(center=0, stddev=1.0)[source]
Bases:
PriorObject for Gaussian priors that only extend to a minimum and maximum value
- Parameters:
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
- log_prior(param, **kwargs)[source]
Returns the log value of the prior given the parameter value
The parameter value is first checked to see if its within
param.bounds. If so then the standard Gaussian distribution is used to calculate the prior.- Parameters:
param (
DysmalParameter) –DysmalParameterobject with which the prior is associated- Returns:
lprior – Log prior value calculated using
pdfifparam.valueis withinparam.bounds- Return type:
- prior_unit_transform(param, u, **kwargs)[source]
Transforms a uniform random variable Uniform[0.,1.] to the prior distribution
- Parameters:
param (
DysmalParameter) –DysmalParameterobject with which the prior is associatedu (float or list-like) – Random uniform variable(s) drawn from Uniform[0.,1.]
- Returns:
v – Transformation of the random uniform variable u to random value(s) drawn from the prior distribution.
- Return type:
float or list-like
- sample_prior(param, N=1, **kwargs)[source]
Returns a random sample of parameter values distributed according to the prior
- Parameters:
param (
DysmalParameter) –DysmalParameterobject with which the prior is associatedN (int, optional) – Size of random sample. Default is 1.
- Returns:
rsamp – Random sample of parameter values
- Return type:
float or array