# Thread: normal density with |z|: MGF and CGF

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

$f_Z(z)=\frac{1}{2}e^{-|z|}$, for $-\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).

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

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

$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=$

$\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

$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:

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

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

2. See this page. Looks like you did it right.

3. Blimey! I had no idea - thanks for pointing this out. Yes, it looks like my MGF is right, if I take mean of zero and b=1.

Oh, and another link shows that the variance of the standard Laplace is also 2!! Houray!