# Moment Generating Function - Negative Binomial

I am trying to find the MGF of

$$P(X=x)=\binom{r+x-1}{x} p^r (1-p)^x$$

where $x=0,1,..., 0<p<1$, and $r>0$ is an integer.

$$E[e^{tx}]=\left( \frac{p}{1-(1-p) e^t} \right)^r$$

where $t < -ln(1-p)$

However, I just don't get it right. I am in need for an explanation for dummies ;)

(Question from "Statistical Inference"' Casella & Berger)

• What solution do you get when $r=1$, which clearly is the most basic case? (Indeed, the solution for $r=1$ immediately produces the solution for general $r$, as explained at en.wikipedia.org/wiki/…) – whuber Jun 14 '17 at 18:30

I think one way to work through it would be by considering the following:

$$E[e^{tx}]= \sum_{x=0}^{\infty}[e^{tx}\binom{r+x-1}{x} p^r (1-p)^x]$$ $$=\frac{p^r}{(r-1)!}\sum_{x=0}^{\infty}[e^t(1-p)]^x\frac{(x+r-1)!}{x!}\frac{(r-1)!}{(r-1)!}$$ $$= p^r\sum_{x=0}^{\infty}[e^t(1-p)]^x\binom{x+r-1}{r-1}$$ $$=p^r[1−(1−p)e^t]^{-r}=\left( \frac{p}{1-(1-p) e^t} \right)^r$$

The first line holds by the definition of mgfs, the second equality you open up $\binom{r+x-1}{x}$ and then multiply and divide by $(r-1)!$ and the last equality holds because $(1-w)^{-r}=\sum\limits_{x=0}^\infty \dbinom{x+r-1}{r-1} w^x$, where $w= (1 − p)e^t$ in our case.

To see why the latter holds, consider the pmf of the negative binomial, which is $P(X=x)=\dbinom{x-1}{r-1}(1-p)^{x-r}p^r>0$ when $0<p<1$ and when summed over the support is equal to 1.

$$\sum\limits_{x=r}^\infty \dbinom{x-1}{r-1}(1-p)^{x-r}p^r=1$$ Now let $k=x-r$, hence $x=k+r$, then: $\sum\limits_{k=0 }^\infty \dbinom{k+r-1}{r-1}(1-p)^{k}p^r=p^r\sum\limits_{k=0 }^\infty\dbinom{k+r-1}{r-1}(1-p)^{k}=p^r [1-(1-p)]^{-r}=1$.

The summation bit after $p^r$ is the negative binomial series which is equal to $[1-(1-p)]^{-r}$.

Let me know if it makes sense!

• +1 This is clear and correct. Maybe it's worth noticing that the Binomial Theorem directly produces this result with a minimum of algebra, because it asserts \eqalign{\left(\frac{p}{1-(1-p)e^t}\right)^r&=p^r(1+-(1-p)e^t)^{-r}\\&=p^r\sum_{x=0}^\infty\binom{-r}{x}(-(1-p)e^t)^x\\&=\sum_{x=0}^\infty\binom{r+x-1}{x}p^r(1-p)^xe^{tx}\\&=E[e^{tX}],} QED. – whuber Jun 14 '17 at 22:53