BaseDistribution#

class BaseDistribution[source]#

Bases: object

Bare-bones class for statistical distributions to provide consistent methods.

This class serves as a template for other distribution classes, defining the common interface for probability density function (PDF), cumulative distribution function (CDF), and statistics.

Attributes:
mean

The mean of the distribution.

median

The median of the distribution.

mode

The mode of the distribution.

stddev

The standard deviation of the distribution.

variance

The variance of the distribution.

Methods

cdf(x)

Compute the cumulative density function (CDF) for the distribution.

logcdf(x)

Compute the log cumulative density function (logCDF) for the distribution.

logpdf(x)

Compute the log probability density function (logPDF) for the distribution.

pdf(x)

Compute the probability density function (PDF) for the distribution.

stats()

Computes and returns the statistical properties of the distribution, including,

pdf(x: float | ndarray) float | ndarray[source]#

Compute the probability density function (PDF) for the distribution.

Parameters:

x – Input array at which to evaluate the PDF.

logpdf(x: float | ndarray) float | ndarray[source]#

Compute the log probability density function (logPDF) for the distribution.

Parameters:

x – Input array at which to evaluate the logPDF.

cdf(x: float | ndarray) float | ndarray[source]#

Compute the cumulative density function (CDF) for the distribution.

Parameters:

x – Input array at which to evaluate the CDF.

logcdf(x: float | ndarray) float | ndarray[source]#

Compute the log cumulative density function (logCDF) for the distribution.

Parameters:

x – Input array at which to evaluate the logCDF.

stats() Dict[str, float][source]#

Computes and returns the statistical properties of the distribution, including,

  1. mean,

  2. median,

  3. variance, and

  4. standard deviation.

Returns:

A dictionary containing statistical properties such as mean, variance, etc.

Return type:

Dict[str, float]

Notes

If any of the parameter is not computable for a distribution, this method returns None.

property mean#

The mean of the distribution.

property median#

The median of the distribution.

property mode#

The mode of the distribution.

property variance#

The variance of the distribution.

property stddev#

The standard deviation of the distribution.