We recommend reading this documentation on
https://alexpghayes.github.io/distributions3/, where the math
will render with additional detail and much greater clarity.
In the following, let \(X\) be a Negative Binomial random variable with
success probability p
= \(p\).
Support: \(\{0, 1, 2, 3, ...\}\)
Mean: \(\frac{p r}{1-p}\)
Variance: \(\frac{pr}{(1-p)^2}\)
Probability mass function (p.m.f):
$$
f(k) = {k + r - 1 \choose k} \cdot (1-p)^r p^k
$$
Cumulative distribution function (c.d.f):
Omitted for now.
Moment generating function (m.g.f):
$$
\left(\frac{1-p}{1-pe^t}\right)^r, t < -\log p
$$