Beta Module

The beta function B(p,q), or the beta integral (also called the Eulerian integral of the first kind) is defined by B(p, q) = (Γ(p) * Γ(q)) / Γ(p+q)

Functions and values

Function or value Description

_beta z w

Full Usage: _beta z w

Parameters:
    z : float - The function input for approximating B(z, w)
    w : float - The function input for approximating B(z, w)

Returns: float

Computes an approximation of the real value of the beta function using approximations for the gamma function using Lanczos Coefficients described in Numerical Recipes (Press et al)

The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input

z : float

The function input for approximating B(z, w)

w : float

The function input for approximating B(z, w)

Returns: float

_betaLn z w

Full Usage: _betaLn z w

Parameters:
    z : float - The function input for approximating ln(B(z, w))
    w : float - The function input for approximating ln(B(z, w))

Returns: float

Computes an approximation of the real value of the log beta function using approximations for the gamma function using Lanczos Coefficients described in Numerical Recipes (Press et al)

The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input

z : float

The function input for approximating ln(B(z, w))

w : float

The function input for approximating ln(B(z, w))

Returns: float

beta z w

Full Usage: beta z w

Parameters:
    z : float - The function input for approximating B(z, w)
    w : float - The function input for approximating B(z, w)

Returns: float

Computes an approximation of the real value of the beta function using approximations for the gamma function using Lanczos Coefficients described in Numerical Recipes (Press et al)

Edge cases in the input (nan, infinity, and -infinity) are catched and handled. This might be slower than the unchecked version `_beta` but does not require input sanitation to get expected results for these cases.

z : float

The function input for approximating B(z, w)

w : float

The function input for approximating B(z, w)

Returns: float

betaLn z w

Full Usage: betaLn z w

Parameters:
    z : float - The function input for approximating ln(B(z, w))
    w : float - The function input for approximating ln(B(z, w))

Returns: float

Computes an approximation of the real value of the log beta function using approximations for the gamma function using Lanczos Coefficients described in Numerical Recipes (Press et al)

Edge cases in the input (nan, infinity, and -infinity) are catched and handled. This might be slower than the unchecked version `_betaLn` but does not require input sanitation to get expected results for these cases.

z : float

The function input for approximating ln(B(z, w))

w : float

The function input for approximating ln(B(z, w))

Returns: float

lowerIncomplete (a, b, x)

Full Usage: lowerIncomplete (a, b, x)

Parameters:
    a : float - The first Beta parameter, a positive real number.
    b : float - The second Beta parameter, a positive real number.
    x : float - The upper limit of the integral.

Returns: float

Returns the lower incomplete (unregularized) beta function

a : float

The first Beta parameter, a positive real number.

b : float

The second Beta parameter, a positive real number.

x : float

The upper limit of the integral.

Returns: float

lowerIncompleteRegularized a b x

Full Usage: lowerIncompleteRegularized a b x

Parameters:
    a : float - The first Beta parameter, a positive real number.
    b : float - The second Beta parameter, a positive real number.
    x : float - The upper limit of the integral.

Returns: float

Returns the regularized lower incomplete beta function

a : float

The first Beta parameter, a positive real number.

b : float

The second Beta parameter, a positive real number.

x : float

The upper limit of the integral.

Returns: float

powerSeries a b x

Full Usage: powerSeries a b x

Parameters:
    a : float
    b : float
    x : float

Returns: float

Power series for incomplete beta integral. Use when b*x is small and x not too close to 1.

a : float
b : float
x : float
Returns: float