# mean and variance from mgf

• Aug 23rd 2009, 11:32 AM
bigdoggy
mean and variance from mgf
The mgf is given by $\displaystyle M_x(t) = {pe^t \over 1 - (1-p)e^t}$

I have the mean as $\displaystyle M_x'(0) = {1 \over p }\mbox{ and the variance as } M_x''(0) - (M_x'(0))^2$$\displaystyle \mbox{ and the variance comes to }{1-p \over p^2}$
is this correct??
• Aug 23rd 2009, 12:48 PM
Moo
Hello,

the best way to spot your mistake is that you show your working ;)
then we'll see what's wrong

for your information, this is the mgf of the geometric distribution
• Aug 24th 2009, 03:05 AM
bigdoggy
For the mean$\displaystyle : M_X'(t)= {(1-(1-p)e^t)pe^t + pe^t(1-p)e^t \over (1-(1-p)e^t)^2}$
and so $\displaystyle M_X'(0)= {1 \over p}$
and $\displaystyle V[X]=M_x''(0)-{[M_x'(0)]}^2={1-p \over p^2}$ does that look correct?
• Aug 24th 2009, 03:10 AM
Moo
okay, you changed your result... now it is correct.

and it's positive, because $\displaystyle 1-p \geq 0$ (p is a probability, so necessarily $\displaystyle \leq 1$)
• Aug 24th 2009, 03:18 AM
bigdoggy
Quote:

Originally Posted by Moo
okay, you changed your result... now it is correct.

and it's positive, because $\displaystyle 1-p \geq 0$ (p is a probability, so necessarily $\displaystyle \leq 1$)

Yeah, I spotted my mistake, but needed to check what I had is correct because I don't have the answer (Evilgrin)
• Aug 24th 2009, 03:20 AM
Moo
Quote:

Originally Posted by bigdoggy
Yeah, I spotted my mistake, but needed to check what I had is correct because I don't have the answer (Evilgrin)

i told you it was the mgf of a geometric distribution :)
the article in wikipedia gives the variance, you could've checked :p