# Moment generating function of the negative binomial distribution.

• Feb 13th 2009, 05:07 PM
synclastica_86
Moment generating function of the negative binomial distribution.
I am trying to find the moment generating function for the negative binomianl distribution. I know that it's baiscly finding <e^ty>. I therefore put e^ty into the sum from y=0 to infinity. I tried a few ways of solving it but I am stuck for quite sime time now. Here is what I tried:

1. Expanding e^ty and use it's summation form. But this only led to showing how the moment generating function works.
2. Use different substitutions to try and get the original form or one of it's varience back with a factor outside the summation. But this is not working too.

Am I going in the right direction?

$\displaystyle P\left (Y=y \right )=\binom{y+r-1}{r-1}p^r\left (1-p \right )^y; Supp\left (Y \right )=\left \{0,1,2,3,... \right \}$
$\displaystyle M_{Y}(t)=E(e^{ty})=\sum_{y=0}^{\infty }e^{ty}\binom{y+r-1}{r-1}p^r\left (1-p \right )^y$
$\displaystyle =\sum_{y=0}^{\infty }\binom{y+r-1}{y}p^r\left (1-p \right )^y\sum_{n=0}^{\infty} \frac{(ty)^n}{n!}$
$\displaystyle =\sum_{n=0}^{\infty}\frac{t^n}{n!}\sum_{y=0}^{\inf ty }\frac{(y+r-1)!}{y!(r-1)!}p^r\left (1-p \right )^yy^n$
$\displaystyle =\sum_{n=0}^{\infty}\frac{t^n}{n!}\ E(y^n)$
• Feb 14th 2009, 08:57 PM
matheagle
To obtain the MGF of a Neg Binomial, you just look at it as a sum of r independent geometrics r.v.s
with parameter p. By independence that just produces the MGF of your Neg Bi as the MGF
of a geo to the power r.
• Feb 15th 2009, 09:33 AM
synclastica_86
Thanks for the solution. It is $\displaystyle \frac{p^r}{(1-(1-p)e^t)^r}$right?
But I am more interested in how these things work. I don't have a strong math background, so please forgive me if I'm asking the obvious.

Generally, I'm more comfortable with the continuous case:
$\displaystyle E(X)=\int_{-\infty}^{\infty}e^{tx}p(x)dx$.
I can evaluate this integral with different tools and techniques.

But the discrete case seems to be more problematic.
I can't use
$\displaystyle E(X)=\sum_{Supp(X)}^{}e^{tx}p(x)dx$
to get anything useful. I think that this is due to a lack of math skills.
Are there any tricks that I should know in general?

Since I now know the answer, I tried working backwards:
$\displaystyle \frac{p^r}{(1-(1-p)e^t)^r}=\sum_{y=0}^{\infty }e^{ty}\binom{y+r-1}{r-1}p^r\left (1-p \right )^y$
$\displaystyle \frac{p^r}{(1-(1-p)e^t)^r}=\frac{p^r}{(1-(1-p)e^t)^r}\sum_{y=0}^{\infty }e^{ty}\binom{y+r-1}{r-1}\left (1-p \right )^y(1-(1-p)e^t)^r$
Therefore, I need to show that:
$\displaystyle 1=\sum_{y=0}^{\infty }e^{ty}\binom{y+r-1}{r-1}\left (1-p \right )^y(1-(1-p)e^t)^r$
$\displaystyle =\sum_{y=0}^{\infty }\binom{y+r-1}{y}(\left (1-p \right )e^t)^y(1-(1-p)e^t)^r$
$\displaystyle =\sum_{y=0}^{\infty }\frac{(y+r-1)!}{y!(r-1)!}(\left (1-p \right )e^t)^y(1-(1-p)e^t)^r$
Now I let: $\displaystyle p'=(1-P)e^t$
$\displaystyle =\sum_{y=0}^{\infty }\frac{(y+r-1)!}{y!(r-1)!}p'^y(1-p')^r$
$\displaystyle =1$because that's just another Neg Bi distribution for p'.
Is this correct?
• Feb 15th 2009, 10:59 AM
Moo
Hello,

You have this sum :

$\displaystyle S=\sum_{y=0}^{\infty }e^{ty}\binom{y+r-1}{r-1}p^r\left (1-p \right )^y$
Since $\displaystyle p^r$ has no y in it, you can factor it out :

$\displaystyle S=p^r \sum_{y=0}^\infty \binom{y+r-1}{r-1} (e^t)^y (1-p)^y$
$\displaystyle S=p^r \sum_{y=0}^\infty \binom{y+r-1}{r-1} [e^t(1-p)]^y$

Now, have a look here : Binomial theorem - Wikipedia, the free encyclopedia (at the end of the paragraph, when they say : "r=-s"). This gives in our case :
$\displaystyle \frac{1}{(1-x)^r}=\sum_{y=0}^\infty \binom{r+y-1}{y} x^y{\color{red}=}\sum_{y=0}^\infty \binom{r+y-1}{r-1} x^y$

The red equality is obtained by the following identity :
$\displaystyle \binom{n+k-1}{k}=\binom{n+k-1}{n-1}$
Proof :
$\displaystyle \binom{n+k-1}{k}=\frac{(n+k-1)!}{k!(n+k-1-k)!}$
$\displaystyle =\frac{(n+k-1)!}{k!(n-1)!}=\frac{(n+k-1)!}{(n-1)!(n+k-1-[n-1])!}=\binom{n+k-1}{n-1}$