Documentation/Calc Functions/NEGBINOMDIST

    From The Document Foundation Wiki

    Function name:

    NEGBINOMDIST

    Category:

    Statistical Analysis

    Summary:

    Calculates negative binomial distribution probabilities from the probability mass function.

    The negative binomial distribution is a discrete probability distribution that is used to analyze data in many domains. It differs from the binomial distribution in that the number of successes is fixed, and the number of independent trials is variable. The first argument to NEGBINOMDIST assumes that the random variable is defined as the number of failures occurring prior to the r-th success (other sources may define the random variable differently, for example it could be the number of trials needed to obtain the r-th success). The function calculates the probability that there will be x failures before the r-th success, with a constant probability p of a success.

    Syntax:

    NEGBINOMDIST(X; R; SP)

    Returns:

    Returns a real number in the range [0, 1], which is the negative binomial distribution probability for the given arguments.

    Arguments:

    X is an integer, or a reference to a cell containing that integer, that is the number of trial failures occurring prior to the R-th success.

    R is an integer, or a reference to a cell containing that integer, that is the threshold number of trial successes.

    SP is a real number (expressed as a percentage, such as 2.5%, or a decimal fraction, such as 0.025), or a reference to a cell containing that number, that is the probability of a successful outcome on each trial. As a probability, SP lies in the range [0, 1] (or equivalently 0% ≤ SP ≤ 100%).

    • If any of X, R, or SP is non-numeric, then NEGBINOMDIST reports a #VALUE! error.
    • If either X or R is a non-integer value, then NEGBINOMDIST truncates it to an integer value.
    • If (after any truncation) X + R is less than or equal to 1, then NEGBINOMDIST reports an invalid argument error (Err:502).
    • If SP is less than 0.0 or greater than 1.0, then NEGBINOMDIST reports an invalid argument error (Err:502).

    Additional details:

    • The following relationship exists between the NEGBINOM.DIST and NEGBINOMDIST functions:
    [math]\displaystyle{ \text{NEGBINOM.DIST}(x;\:r;\:p;\:0)~=~\text{NEGBINOMDIST}(x;\:r;\:p) }[/math]
    • The formula for NEGBINOMDIST is:
    [math]\displaystyle{ \begin{align} \text{NEGBINOMDIST}(x;\:r;\:p)~&=~\binom{x\:+\:r\:-\:1}{r-1}\:\times\:(1\:-\:p)^{x}\:\times\:p^{r}\\&=~\frac{(x\:+\:r\:-\:1)!}{(r\:-\:1)!\:x!} \times\:(1\:-\:p)^{x}\:\times\:p^{r}\\ \end{align} }[/math]

    Examples:

    Formula Description Returns
    =NEGBINOMDIST(A1; A2; A3) where cells A1:A3 contain the number 5, the number 2, and the formula =1/6 respectively. Suppose we repeatedly roll a single fair (unbiased) die and consider a successful trial outcome to be when we roll a 6. This outcome occurs with a probability of 1/6 on each trial. What is the probability of observing the second success on the seventh trial? Here the function calculates the probability as 6.70%. Note that the first argument is set to the value 5, which equates to the total trials required (7) minus the specified number of successes (2). 0.0669795953360768
    =NEGBINOMDIST(0; 2; 1/6) Similar to the previous example, except here the formula calculates the probability of observing the second success on the second trial. The value returned is 2.78% and this is equal to [math]\displaystyle{ \left( \frac{1}{6} \right)^2 }[/math]. 0.0277777777777778
    =NEGBINOMDIST(5; 5; 50%) Suppose that we flip a fair (unbiased) coin. For each flip, the result will be either a head or a tail, and each of these will occur with an equal probability of 0.5 or 50%. Here the function calculates the probability that the fifth head will occur on the tenth flip, returning the value 12.30%. 0.123046875

    Related LibreOffice functions:

    NEGBINOM.DIST

    ODF standard:

    Section 6.18.51, part 2

    Related (or similar) Excel functions:

    NEGBINOMDIST