normal density with |z|: MGF and CGF

This is sample question to which the study guide does not provide an answer. I'd appreciate if you could check and make comments on my mistakes/narratives.

Question.

Let Z be a random variable with density

$\displaystyle f_Z(z)=\frac{1}{2}e^{-|z|}$, for $\displaystyle -\infty<z<\infty$.

(a) show that f_Z is a valid density

(b) find the moment generating function of Z and give an open interval around the origin in which the moment generating function is well-defined.

(c) by considering the cumulant generating function or otherwise, evaluate E(Z) and Var (Z).

Answer.

(a) since |z|=-z if z<0, and |z|=z when $\displaystyle z\geq0$, I split the integration into two parts:

$\displaystyle f_Z(z)=\int_{-\infty}^0\frac{1}{2}e^zdz+\int_0^{\infty}\frac{1}{ 2}e^{-z}dz=1$ after some eliminations of negative powers of exp.

(b) I use the same 'split interval' when I need to calculate Mx(t)

$\displaystyle M_X(t)=E(e^{zt})=\int_{-\infty}^{\infty}e^{zt}\frac{1}{2}e^{-|z|}dz=\frac{1}{2}\int_{-\infty}^{\infty}e^{zt-|z|}dz=\frac{1}{2}\int_{-\infty}^0e^{zt+z}dz+\frac{1}{2}\int_0^{\infty}e^{z t-z}dz=$

$\displaystyle \frac{1}{2}[\frac{1}{t+1}e^{z(t+1)}]_{-\infty}^0+\frac{1}{2}[\frac{1}{t-1}e^{z(t-1)}]^{\infty}_0=\frac{1}{2}\frac{1}{t+1}-\frac{1}{2}\frac{1}{t-1}=\frac{1}{1-t^2}$

bounds on t: for the function M to be integrable on the whole real line, the following must hold: z(t-1)<0 and z(t+1)>0; this leads to -1<t<1.

(c) cumulant generating function

$\displaystyle K_X(t)=lnM_X(t)=ln(\frac{1}{1-t^2})=-ln(1-t^2)$

E(Z) can then be found as the first derivative of Kx(t) around zero, and Var (Z) can be found as the second derivative of Kx(t) around zero:

$\displaystyle E(Z)=\frac{d}{dt}(-ln(1-t^2))=\frac{2t}{1-t^2}$. If t=0, E(Z)=0

$\displaystyle Var(Z)=\frac{d^2}{dt^2}(-ln(1-t^2))=\frac{d}{dt}(\frac{2t}{1-t^2})=\frac{2+2t^2}{(1-t^2)^2}$. If t=0, this evaluates to 2.