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).alpha (
Operand|int|float) – The shape parameter α of the distribution (must be > 0).beta (
Operand|int|float) – The scale parameter β of the distribution (must be > 0).cumulative (
Operand|bool) –Boolean flag to determine calculation type:
False / 0: PDF
True / 1: CDF
- Return type:
- 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
- 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
``x`` — accepted types
DECIMAL
DECIMAL_ARRAY
INTEGER
INTEGER_ARRAY
``arg_2`` — accepted types
DECIMAL
DECIMAL_ARRAY
INTEGER
INTEGER_ARRAY
``arg_3`` — accepted types
DECIMAL
DECIMAL_ARRAY
INTEGER
INTEGER_ARRAY
``cumulative`` — accepted types
BOOLEAN
BOOLEAN_ARRAY
DECIMAL
DECIMAL_ARRAY
INTEGER
INTEGER_ARRAY
Return types
DECIMAL
DECIMAL_ARRAY