Documentation/Calc Functions/GAMMA.DIST

    From The Document Foundation Wiki

    Function name:

    GAMMA.DIST

    Category:

    Statistical Analysis

    Summary:

    Calculates gamma distribution values from either the probability density function or the cumulative distribution function.

    The gamma distribution is a family of continuous probability distributions that are typically used to model positive variables that have right-skewed distributions. The distribution has two characteristic positive real numbers, usually denoted as alpha (α) and beta (β), that control its shape and rate respectively.

    Syntax:

    GAMMA.DIST(Number; Alpha; Beta; Cumulative)

    Returns:

    Returns a non-negative real number, which is the gamma distribution value for the given arguments. For the probability density function, the value returned lies in the range [0, +∞). For the cumulative distribution function, the value returned lies in the range [0, 1].

    Arguments:

    Number is a non-negative real number, or a reference to a cell containing that number, which is the value at which the gamma distribution is to be evaluated.

    Alpha is a positive real number, or a reference to a cell containing that number, which is the value of the shape parameter of the gamma distribution.

    Beta is a positive real number, or a reference to a cell containing that number, which is the value of the rate parameter of the gamma distribution.

    Cumulative is a logical value, or a reference to a cell containing that value, that determines whether the required probability is taken from the probability density function or the cumulative distribution function. If Cumulative is set to 0 or FALSE, a value from the probability density function is calculated. For any other values of Cumulative a value from the cumulative distribution function is calculated.

    • If any of Number, Alpha, or Beta is non-numeric, then GAMMA.DIST reports a #VALUE! error.
    • If either Alpha or Beta is less than or equal to 0.0, then GAMMA.DIST reports an invalid argument error (Err:502).
    • If Number is less than 0.0, then GAMMA.DIST reports an invalid argument error (Err:502).
    • Other errors may arise depending on the exact combination of values passed as arguments to GAMMA.DIST.

    Additional details:

    • Calc's GAMMADIST and GAMMA.DIST functions perform similar calculations. However, there are minor differences between the two functions with respect to their arguments – for GAMMADIST the Cumulative argument may be omitted and negative Number values are accepted. The requirements for GAMMADIST are specified in ODF 1.2; GAMMA.DIST is provided for interoperability with Microsoft Excel.
    • The formula for the probability density function of the gamma distribution can be written as:
    [math]\displaystyle{ PDF_{gamma}(x, \alpha, \beta)~=~\frac{1}{\beta^\alpha\:\Gamma(\alpha)}\:x^{\alpha-1}\:e^{-\frac{x}{\beta}} }[/math]
    where x ≥ 0, α > 0, and β > 0.
    • The formula for the cumulative distribution function of the gamma distribution can be written as:
    [math]\displaystyle{ CDF_{gamma}(x, \alpha, \beta)~=~\frac{1}{\beta^\alpha\:\Gamma(\alpha)}\int_{0}^{x}\:t^{\alpha-1}\:e^{-\frac{t}{\beta}} \:dt }[/math]
    where x ≥ 0, α > 0, and β > 0.
    • The following figure shows four sample probability density function plots for the gamma distribution.
    Gamma distribution PDF plots.png
    • The following figure shows four sample cumulative distribution function plots for the gamma distribution.
    Gamma distribution CDF plots.png
    • The name space for GAMMA.DIST is COM.MICROSOFT.GAMMA.DIST.
    • For more information on the gamma distribution, visit Wikipedia's Gamma distribution page.

    Examples:

    Formula Description Returns
    =GAMMA.DIST(A1; A2; A3; A4) where cells A1:A4 contain the numbers 4.7, 3.4, 2.7, and 0 respectively. Here the function calculates the value of the probability density function for the given inputs. 0.0824160723859134
    =GAMMA.DIST(4.7; 3.4; 2.7; 1) Here the function calculates the value of the cumulative distribution function for the same input values as in the previous example. 0.178647117849697
    =GAMMA.DIST(0; 2; 4; 0) Here the function returns 0 for Number equal to 0. 0
    =GAMMA.DIST(-2; 2; 4; 0) Here the function returns an error for negative values of Number. Contrast this with the formula =GAMMADIST(-2; 2; 4; 0) which returns 0. Err:502

    Related LibreOffice functions:

    GAMMA.INV

    GAMMADIST

    GAMMAINV

    ODF standard:

    None

    Related (or similar) Excel functions:

    GAMMA.DIST