runlmc.parameterization.priors module

This modules contains Prior, the base type for all priors available.

class runlmc.parameterization.priors.Gamma(a, b)[source]

Bases: runlmc.parameterization.priors.Prior

domain = 'positive'
static from_EV(E, V)[source]

Creates an instance of a Gamma Prior with prescribed statistics

Parameters:
  • E – expected value
  • V – variance
lnpdf(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the log density of the prior at (each) x
lnpdf_grad(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the gradient of the log density of the prior at (each) x
class runlmc.parameterization.priors.Gaussian(mu, var)[source]

Bases: runlmc.parameterization.priors.Prior

domain = 'real'
lnpdf(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the log density of the prior at (each) x
lnpdf_grad(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the gradient of the log density of the prior at (each) x
class runlmc.parameterization.priors.HalfLaplace(b)[source]

Bases: object

domain = 'positive'
lnpdf(x)[source]
lnpdf_grad(_)[source]
class runlmc.parameterization.priors.InverseGamma(a, b)[source]

Bases: runlmc.parameterization.priors.Prior

domain = 'positive'
lnpdf(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the log density of the prior at (each) x
lnpdf_grad(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the gradient of the log density of the prior at (each) x
class runlmc.parameterization.priors.Prior[source]

Bases: object

Prior allows for incorporating a Bayesian prior in the first-order gradient-based optimization performed on the GP models.

Priors are placed over scalar values.

Prior objects are immutable.

Methods are intended to be vectorized over parameters with the same priors. In other words, mapping lnpdf() and lnpdf_grad() over each point individually should produce the same result as passing in a list of those points.

domain = None
Attribute domain:
 Domain on which the prior is defined
lnpdf(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the log density of the prior at (each) x
lnpdf_grad(x)[source]
Parameters:x – query float or numpy array (for multiple parameters with this same prior)
Returns:the gradient of the log density of the prior at (each) x