Factsheet: Negative binomial distribution
Where to use: The negative binomial distribution is often used to handle over-dispersed data, which means the variance exceeds the mean. It can serve as an alternative to the Poisson distribution, as the Poisson distribution assumes that the mean is equal to the variance. \(X\) represents the number of trials required to reach the targeted number of successes \(r\).
Notation: \(X \sim \textrm{NB}(r,p)\)
Parameters: Two numbers \(r,p\) where:
- \(r\) is an integer representing the targeted number of successes,
- \(p\) is a real number representing the probability of success in a single trial (where \(0 \le p \le 1\)).
| Quantity | Value | Notes |
|---|---|---|
| Mean | \(\mathbb{E}(X) = \dfrac{r(1-p)}{p}\) | |
| Variance | \(\mathbb{V}(X) = \dfrac{r(1-p)}{p^2}\) | |
| PMF | \(\mathbb{P}(X=x)=\dfrac{(x+r-1)!}{(r-1)!x!}(1-p)^xp^r\) | |
| CDF | \(\displaystyle\mathbb{P}(X\leq x)=\sum^{x}_{i=1}\frac{(x+r-1)!}{(r-1)!x!}(1-p)^xp^r\) |
Example: You flip a coin multiple times, and the probability of getting ‘heads’ is \(0.5\). You decide to stop flipping the coin once you get \(3\) ‘heads’; these do not have to be consecutive. Taking ‘heads’ as a success, this can be expressed as \(X \sim \textrm{NB}(3,0.5)\). It means the probability of success is \(0.5\), and you will stop conducting trials after you reach \(3\) successes.
Further reading
This interactive element appears in Overview: Probability distributions..
Version history
v1.0: initial version created 08/25 by tdhc.
- v1.1: deprecated shinylive apps replaced 09/26 by tdhc.