# mean and variance from mgf

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

I have the mean as $M_x'(0) = {1 \over p }\mbox{ and the variance as } M_x''(0) - (M_x'(0))^2$ $\mbox{ and the variance comes to }{1-p \over p^2}$
is this correct??
• August 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
• August 24th 2009, 03:05 AM
bigdoggy
For the mean $: 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 $M_X'(0)= {1 \over p}$
and $V[X]=M_x''(0)-{[M_x'(0)]}^2={1-p \over p^2}
$
does that look correct?
• August 24th 2009, 03:10 AM
Moo
okay, you changed your result... now it is correct.

and it's positive, because $1-p \geq 0$ (p is a probability, so necessarily $\leq 1$)
• August 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 $1-p \geq 0$ (p is a probability, so necessarily $\leq 1$)

Yeah, I spotted my mistake, but needed to check what I had is correct because I don't have the answer (Evilgrin)
• August 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