Niemi Consulting

cutting-edge statistical consulting

Entries Comments



Negative binomial random variable

9 July, 2008 (11:36) | introductory, random variables | By: jarad

Continuing our discussion of random variables, we introduce a random variable called the negative binomial. Although it is not one that I use very often, I thought it was a nice transition from the Bernoulli and binomial random variables which have a finite number of values to the random variables that have an infinite number of values.

The negative binomial is also related to the Bernoulli, but it answers the question: how many negative outcomes occur before a set number of positive outcomes? Here are some examples:

  • number of tails before 3 heads when flipping a coin (3,1/2)
  • number of ones and twos before 5 fours when rolling a six-sided die (5,1/3)
  • number of losses before the MN Twins win 10 baseball games (10,?)

The notation we use for a negative binomial random variable is:

Y~NBin(r,p)

and we say `Y is a negative binomial random variable waiting for r positive outcomes and each trial has probability p.’

Similar to the binomial random variable, this random variable has two parameters. The parameter that is common to both of these random variables is p, the probability of a positive outcome. The new parameter is r, the number of positive outcomes. With the same p, we expect that Y will generally be larger if r is larger. The parameters for the examples given above are provided in the parentheses. For the third example, we do not know what the probability of a success will be and therefore I have put a question mark here.

The probability mass function is

f(y)=(n choose y) y^p(1-p)^{1-y}

The notation used in this pmf is explained in the binomial random variable post. When discussing the binomial random variable, I mentioned that the random variable has a finite number of values it can be, namely integers from 0 up to n. The negative binomial random variable does not have this restriction.

This is clearly demonstrated with the coin flipping example. Ask yourself the question, what is the maximum number of tails you could possibly observe before observing 3 heads? The answer is that there is no maximum. Therefore y can take on integer values from 0 up to infinity.

Bottom Line: A negative binomial random variable can be used to model the number of negative outcomes observed until a fixed number of positive outcomes occur.

Comments

Pingback from Niemi Consulting » Poisson random variable
Time: July 10, 2008, 11:18 am

[...] we discussed the negative binomial random variable and we mentioned that it has an infinite number of values consisting of all natural [...]

Write a comment