pybop.parameters.priors#

Classes#

Exponential

Represents an exponential distribution with a specified scale parameter.

Gaussian

Represents a Gaussian (normal) distribution with a given mean and standard deviation.

Uniform

Represents a uniform distribution over a specified interval.

Module Contents#

class pybop.parameters.priors.Exponential(scale)[source]#

Represents an exponential distribution with a specified scale parameter.

This class provides methods to calculate the pdf, the log pdf, and to generate random variates from the distribution.

Parameters:

scale (float) – The scale parameter (lambda) of the exponential distribution.

__repr__()[source]#

Returns a string representation of the Uniform object.

logpdf(x)[source]#

Calculates the logarithm of the pdf of the exponential distribution at x.

Parameters:

x (float) – The point at which to evaluate the log pdf.

Returns:

The log of the probability density function value at x.

Return type:

float

pdf(x)[source]#

Calculates the probability density function of the exponential distribution at x.

Parameters:

x (float) – The point at which to evaluate the pdf.

Returns:

The probability density function value at x.

Return type:

float

rvs(size)[source]#

Generates random variates from the exponential distribution.

Parameters:

size (int) – The number of random variates to generate.

Returns:

An array of random variates from the exponential distribution.

Return type:

array_like

Raises:

ValueError – If the size parameter is negative.

property mean[source]#
Returns the mean of the distribution.
property sigma[source]#
Returns the standard deviation of the distribution.
class pybop.parameters.priors.Gaussian(mean, sigma)[source]#

Represents a Gaussian (normal) distribution with a given mean and standard deviation.

This class provides methods to calculate the probability density function (pdf), the logarithm of the pdf, and to generate random variates (rvs) from the distribution.

Parameters:
  • mean (float) – The mean (mu) of the Gaussian distribution.

  • sigma (float) – The standard deviation (sigma) of the Gaussian distribution.

__repr__()[source]#

Returns a string representation of the Gaussian object.

logpdf(x)[source]#

Calculates the logarithm of the probability density function of the Gaussian distribution at x.

Parameters:

x (float) – The point at which to evaluate the log pdf.

Returns:

The logarithm of the probability density function value at x.

Return type:

float

pdf(x)[source]#

Calculates the probability density function of the Gaussian distribution at x.

Parameters:

x (float) – The point at which to evaluate the pdf.

Returns:

The probability density function value at x.

Return type:

float

rvs(size)[source]#

Generates random variates from the Gaussian distribution.

Parameters:

size (int) – The number of random variates to generate.

Returns:

An array of random variates from the Gaussian distribution.

Return type:

array_like

Raises:

ValueError – If the size parameter is negative.

class pybop.parameters.priors.Uniform(lower, upper)[source]#

Represents a uniform distribution over a specified interval.

This class provides methods to calculate the pdf, the log pdf, and to generate random variates from the distribution.

Parameters:
  • lower (float) – The lower bound of the distribution.

  • upper (float) – The upper bound of the distribution.

__repr__()[source]#

Returns a string representation of the Uniform object.

logpdf(x)[source]#

Calculates the logarithm of the pdf of the uniform distribution at x.

Parameters:

x (float) – The point at which to evaluate the log pdf.

Returns:

The log of the probability density function value at x.

Return type:

float

pdf(x)[source]#

Calculates the probability density function of the uniform distribution at x.

Parameters:

x (float) – The point at which to evaluate the pdf.

Returns:

The probability density function value at x.

Return type:

float

rvs(size)[source]#

Generates random variates from the uniform distribution.

Parameters:

size (int) – The number of random variates to generate.

Returns:

An array of random variates from the uniform distribution.

Return type:

array_like

Raises:

ValueError – If the size parameter is negative.

property mean[source]#
Returns the mean of the distribution.
property sigma[source]#
Returns the standard deviation of the distribution.