# mean and variance from mgf

• Aug 23rd 2009, 12:32 PM
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??
• Aug 23rd 2009, 01: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, 04: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?
• Aug 24th 2009, 04: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$)
• Aug 24th 2009, 04: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)
• Aug 24th 2009, 04: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