I'm trying to derive the mean and variance for the Poisson distribution but I'm encountering a problem and I believe its due to my derivatives.
So the mgf for poisson is: $M_x(t)=e^{\lambda e^t-\lambda}$ where $x=0,1,2..$ and $\lambda \geq 0 $
So to find the mean, i need to plug in $0$ in the derivative of the mgf.
Here is what I did:
$M'x(t)=e^{\lambda e^t-\lambda} \lambda e^t=(\lambda e^t)(e^{\lambda e^t-\lambda})=\lambda e^{\lambda e^t-\lambda+t}$
So when i plug in $t=0$ i actually get the mean to be $\lambda$, however I realize my error when I started calculating the variance.
Variance=$E(x^2)-\mu^2$
$\mu^2=\lambda^2$
$E(x^2)=M''x(0)$
When I calculate the second derivative, I get:
$M''x(t)=\lambda e^{\lambda e^t-\lambda+t} \lambda e^t +1$
That 1 is what is making my answer wrong since the variance is also $\lambda$ but i cant seem to find my error.