# Thread: mean and variance from mgf

1. ## 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??

2. 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

3. 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?

4. 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$)

5. 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

6. 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
i told you it was the mgf of a geometric distribution
the article in wikipedia gives the variance, you could've checked