Polynomial Functions#

This section documents functional components included within the distribution module, which do not represent true probability distributions, but are provided for convenience when modeling or fitting simple mathematical functions.

These function-like classes implement a pdf(x) method that evaluates the corresponding mathematical expression at the input values x, returning a NumPy array of outputs. This allows them to be used interchangeably with other distribution-like objects in modeling pipelines where only functional evaluation is needed. They are especially useful in scenarios where you wish to fit or visualize basic curves (e.g., lines, quadratics) alongside or in place of statistical distributions.

The following classes are currently available:

class LineFunction(slope: float = 1.0, intercept: float = 1.0, normalize: bool = False)[source]#

Methods

pdf(x)

Calculates the line function.

pdf(x: ndarray) ndarray[source]#

Calculates the line function.

Parameters:
xnp.ndarray

Input array of values.

Returns:
np.ndarray

Array of the same shape as \(x\), containing the evaluated values.

class QuadraticFunction(a: float = 1.0, b: float = 1.0, c: float = 1.0, normalize: bool = False)[source]#

Methods

pdf(x)

Calculates the quadratic function.

pdf(x: ndarray) ndarray[source]#

Calculates the quadratic function.

Parameters:
xnp.ndarray

Input array of values.

Returns:
np.ndarray

Array of the same shape as \(x\), containing the evaluated values.

class CubicFunction(a: float = 1.0, b: float = 1.0, c: float = 1.0, d: float = 1.0, normalize: bool = False)[source]#

Methods

pdf(x)

Calculates the cubic function.

pdf(x: ndarray) ndarray[source]#

Calculates the cubic function.

Parameters:
xnp.ndarray

Input array of values.

Returns:
np.ndarray

Array of the same shape as \(x\), containing the evaluated values.