The negative binomial distribution is a discrete distribution with two parameters and where and . It has positive probabilities at the non-negative integers . So it can potentially be used as a model for the random count of a phenomenon of interest. In some cases, the negative binomial distribution has a natural interpretation. In fact, the natural interpretation should be how the negative binomial distribution is introduced. With the parameter being a positive integer, the negative binomial distribution can be naturally interpreted as the discrete waiting time until the th success. But this natural interpretation does not apply to the general case of being only a positive real number but not necessarily an integer. However, once the natural case that being a positive integer is understood, it is easy to make a leap to the general case that is any positive real number. In this post, we focus on the “natural” version of the negative binomial distribution, where is a positive integer. In this case, there is a natural way to look at the cumulative distribution function (cdf) and the survival function. The discussion in this post will complement the following posts on the negative binomial distribution.

________________________________________________________________________

**The probability functions**

A Bernoulli trial is a random experiment in which there are two distinct outcomes. For convenience, they are called success (S) and failure (F). Consider performing a sequence of independent Bernoulli trials such that each trial has the same probability of success . Fix a positive integer . In some cases, we would like to count the number of trials that produce the th success. Let’s call this count . In other cases, we may want instead to count the number of failures before getting the th success. Let’s call this count . According to the discussion in the two posts listed above, the probability functions of and are:

When , the resulting distribution is called the geometric distribution.

Because the parameter is a positive integer, all the above probability functions have an combinatorial explanation. For the probability function in (1), there are many trials. The last Bernoulli trial is the th success. Then all the preceding trails have at most successes. Hence we have the binomial coefficient in (1). For the probability function in (2), there are trials ( successes and failures). Again, the last Bernoulli trial is the th success. So in the preceding trials, there are exactly successes and exactly failures. Hence we have the binomial coefficient in (2). Let’s look at some examples.

*Example 1*

Four different prizes are randomly put into boxes of cereal. One of the prizes is a free ticket to the local zoo. Suppose that a family of four (called Family A) decides to buy this cereal until obtaining four free tickets to the zoo. What is the probability that the family will have to buy 10 boxes of cereal to obtain the four free tickets to the zoo? What is the probability that the family will have to buy 16 boxes of cereal to obtain the four free tickets to the zoo?

In this example, the success is a box of cereal with a free ticket to the zoo. So getting a ticket to the zoo is considered a success. Any one of the other three prizes is considered undesirable or a failure. Any one of the four prizes is equally likely. The negative binomial distribution in this example has and . The count of the boxes of cereal to be purchased is the random variable as described in (1) above. The following gives the answers.

*Example 2 (Example 1 continued)*

Suppose Family A agrees to give any one of the undesirable prizes away to another family (called Family B). What is the probability that Family A will give 5 undesirable prizes to Family B before obtaining the four desirable tickets to the zoo? What is the probability that Family A will give 12 undesirable prizes to Family B before obtaining the four tickets to the zoo?

The negative binomial distribution in this example has and . The interest here is to count the number failures (undesirable prizes) before getting 4 successes. Thus the random variable of interest is as described in (2) above. The following gives the answers.

Here’s the mean and variance for both examples.

Thus Family A is expected to buy 16 boxes of cereal to get the 4 tickets to the zoo and is expected to give 12 prizes to the other family. However, the variance is fairly large. As a result, the actual number of boxes purchased can vary from the mean by a large amount.

_______________________________________________________________________

**The survival functions and the cumulative distribution functions**

For any random variable , the cumulative distribution function is where can range over all real numbers or a relevant set of real numbers . The survival function is . The term survival comes from the interpretation that is the probability of a life surviving beyond time if is meant to model the lifetime of a biological life or some system. Even when is not a lifetime random variable, we still use the term survival function for .

Example 1 asks the probability of a certain number of trials in order to get th success and the probability of a certain number of failures before getting the th success. Sometimes it is more informative to know how many trials that are required to be performed in order to achieve one’s goal. For example, it may be useful to know the mean number of trials or the probability of achieving the goal in trials or less. In some cases, it may take time and resource to perform the random Bernoulli trials. It will be helpful to know ahead of time the likelihood of achieving one’s goal given the resources that are available. In the above examples, it will be helpful for Family A to have a better and clearer sense of how many boxes of cereal are to be purchased. Therefore, it is worthwhile to look at the cdf and the survival function of the negative binomial distribution.

In terms of basic principle, here’s the survival functions for the distribution described in (1) and (2).

The cumulative distribution functions can be defined by basic principle or by taking the complement as follows:

*Example 3 (the above examples continued)*

What is the probability that Family A will buy more than 16 boxes in order to obtain the 4 free tickets to the zoo? What is the probability that Family A will give away at most 10 undesirable prizes before obtaining the 4 free tickets to the zoo?

Working from the definition, here’s the answers:

The mean number of boxes of cereal purchased is 16 as indicated earlier. Since the variance is large, there is still a significance chance (about 40%) that Family A will have to buy more than 16 boxes of cereal before achieving their goal. On the other hand, there is good chance (about 48%) that Family will give away at most 10 undesirable prizes.

Note that the calculation for is based on , which requires the calculation of 17 probabilities. The calculation for , which requires 11 probabilities. Such calculation can be done by software of course. There is a natural way of looking at the calculation for (3), (4), (5) and (6). This alternative approach will give much better insight on the negative binomial distribution.

_______________________________________________________________________

**A more natural way of interpreting the survival function**

We now discuss a better way to look at the survival functions in (3) and (4). Consider the event and the event . We will see that the negative binomial survival function can be related to the cdf of a binomial distribution.

For the event to occur, the th success occurs after performing trials. So it will take trials or more to get the th success. This means that in the first trials, there are at most successes. The following highlights the equivalent statements.

The last statement is a binomial distribution. Specifically, it is the binomial distribution with trials and the probability of success . Let’s denote the count of successes of this binomial distribution by . Thus we can relate the survival function in (3) with the cdf of as follows:

The advantage of (7) is that it gives us the insight of relating the negative binomial distribution with the binomial distribution. In terms of computation, (7) only requires many binomial probabilities. Thus Example 3 only requires the computation of 4 probabilities (versus 17 previously).

Note that . Thus the event is the same as the event . So we can just piggy back on the work done in (7). For the sake of the more clarity, here’s a translation for the event .

As before, let denote the number of successes in performing Bernoulli trials with as the probability of success. Based on the above translation, the following gives the survival function for the negative binomial random variable .

For both negative binomial random variables and , the survival functions can be computed using (7) and (8), respectively. Rote memorization of the formulas (7) and (8) is not recommended. Instead, focus on the thought process that translate the events and into a binomial distribution.

*Example 4 (the above examples continued)*

We now rework Example 3 using the ideas presented in (7) and (8).

*Example 5 (the above examples continued)*

What is the median number of boxes of cereal purchased by Family A in order to obtain 4 boxes with the prize of free ticket to the zoo? What is the median number of boxes of cereal with undesirable prizes that are purchased by Family A?

We have the following probabilities.

This means that the median number of boxes to be purchased is 15. One way to look at it is that 15 is the first number such that is greater than 0.5. Then the median number of boxes with undesirable prizes is 11 (15 less 4).

_______________________________________________________________________

**Comparing with the Gamma distribution**

The thought process discussed in (7) and (8) certainly gives a more efficient way to calculate the cumulative distribution function and the survival function of the negative binomial distribution. Even though the negative binomial cdf can be calculated easily by software, the ideas in (7) and (8) provides a formulation that gives more insight on the negative binomial distribution.

The though process in (7) and (8) is analogous to the relationship between the Gamma distribution and the Poisson distribution. Consider the Gamma distribution where the shape parameter is a positive integer and the rate parameter can be any positive real number. Then the following is the density function of the Gamma distribution under consideration:

The Gamma distribution described by the density function in (9) can be interpreted as a waiting time – the waiting time until the th change in a Poisson process. Thus, if the th change takes place after time , there can be at most arrivals in the time interval . Thus the survival function of this Gamma distribution is the same as the cdf of a Poisson distribution. The survival function in (7) is analogous to the following relation.

The idea for (7) and (8) is the waiting time until the th success where each success or failure is based on a Bernoulli process. The resulting probability distribution is a discrete waiting time process. The idea for (10) is the waiting time until the th change where each change is based on a Poisson counting process. The resulting probability distribution is a continuous waiting time process. It is not necessary to memorize these formulas. It is easy to reproduce (7), (8) and (10) from the underlying thought processes.

________________________________________________________________________

Pingback: The big 3 claim frequency models | Topics in Actuarial Modeling

Pingback: Negative binomial distribution – A World of Ideas