GAMMADIST

GAMMADIST(x, alpha, beta, cumulative)[source]

Calculates the gamma distribution probability density (PDF) or cumulative distribution (CDF).

GAMMADIST evaluates either the probability density function (PDF) or the cumulative distribution function (CDF) of the gamma distribution for the given input(s).

Parameters:
  • x (Operand | int | float) –

    The input value(s) at which to evaluate the distribution (must be ≥ 0).

    Supported types:

    • INTEGER

    • DECIMAL

    • INTEGER_ARRAY

    • DECIMAL_ARRAY

  • alpha (Operand | int | float) –

    The shape parameter α of the distribution (must be > 0).

    Supported types:

    • INTEGER

    • DECIMAL

    • INTEGER_ARRAY

    • DECIMAL_ARRAY

  • beta (Operand | int | float) –

    The scale parameter β of the distribution (must be > 0).

    Supported types:

    • INTEGER

    • DECIMAL

    • INTEGER_ARRAY

    • DECIMAL_ARRAY

  • cumulative (Operand | bool) –

    Boolean flag to determine calculation type:

    • False / 0: PDF

    • True / 1: CDF

    Supported types:

    • BOOLEAN

    • BOOLEAN_ARRAY

Return type:

Formula

Returns:

A formula object evaluating to the gamma distribution value(s).

  • Returns DECIMAL if all inputs are scalar

  • Returns DECIMAL_ARRAY if any input is an array

Supported types:

  • DECIMAL

  • DECIMAL_ARRAY

Raises:
  • ValueError – If x, alpha, or beta are not numeric types

  • ValueError – If cumulative is not boolean-compatible

Examples

Probability density function (PDF):

GAMMADIST(2.0, 3.0, 1.0, False)
# Returns the PDF at x=2 for a gamma distribution with shape=3, scale=1

Cumulative distribution function (CDF):

GAMMADIST(2.0, 3.0, 1.0, True)
# Returns the CDF at x=2 for a gamma distribution with shape=3, scale=1

Array inputs:

GAMMADIST(my_table["value"], 3.0, 1.0, True)
# Returns an array of CDF values for each row