Error in proof of MGF of standard half normal distribution?

933 Views Asked by At

I'm not getting the standard answer of but I'm not sure what's wrong with my reasoning. Any insight appreciated.

Let $Z \sim N(0,1)$. We want to find the MGF of $\left|Z\right|$. By definition:

$$\psi_{\left|Z\right|}(t) = \int_{-\infty}^{\infty} e^{t\left|z\right|}f_z(z)dz$$

Then since $e^{t\left|z\right|}f_z(z)$ is a product of two even functions, it is also an even function, so it's symmetrical around the y-axis and:

$$\psi_{\left|Z\right|}(t) = 2\int_{0}^{\infty} e^{tz}f_z(z)dz$$

Now we can substitute in the PDF definition:

$$\psi_{\left|Z\right|}(t) = 2\int_{0}^{\infty} e^{tz}\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}z^2}dz$$

Now we can do some plain old algebra:

$$\psi_{\left|Z\right|}(t) = \frac{2}{\sqrt{2\pi}}\int_{0}^{\infty} e^{tz}e^{-\frac{1}{2}z^2}dz$$

$$\psi_{\left|Z\right|}(t) = \frac{2}{\sqrt{2\pi}}\int_{0}^{\infty} e^{-\frac{1}{2}z^2 + tz}dz$$

$$e^{-\frac{1}{2}t^2}\cdot\psi_{\left|Z\right|}(t) = e^{-\frac{1}{2}t^2}\frac{2}{\sqrt{2\pi}}\int_{0}^{\infty} e^{-\frac{1}{2}z^2 + tz}dz$$

$$e^{-\frac{1}{2}t^2}\cdot\psi_{\left|Z\right|}(t) = \frac{2}{\sqrt{2\pi}}\int_{0}^{\infty} e^{-\frac{1}{2}z^2 + tz - \frac{1}{2}t^2}dz$$

$$e^{-\frac{1}{2}t^2}\cdot\psi_{\left|Z\right|}(t) = \frac{2}{\sqrt{2\pi}}\int_{0}^{\infty} e^{-\frac{1}{2}(z^2 - 2tz + t^2)}dz$$

$$e^{-\frac{1}{2}t^2}\cdot\psi_{\left|Z\right|}(t) = \frac{2}{\sqrt{2\pi}}\int_{0}^{\infty} e^{-\frac{1}{2}(z-t)^2}dz$$

Put that aside for a moment. From the fact that PDF formula for the normal distribution sums to 1 it is possible to deduce that:

$$\int_{-\infty}^{\infty} e^{-\frac{1}{2\sigma^2}(x-\mu)^2}dx = \sigma\sqrt{2\pi}$$

Then since the function is even we can infer:

$$\int_{0}^{\infty} e^{-\frac{1}{2\sigma^2}(x-\mu)^2}dx = \frac{\sigma\sqrt{2\pi}}{2}$$

So now we can go back, using $\sigma=1, \mu=t$:

$$e^{-\frac{1}{2}t^2}\cdot\psi_{\left|Z\right|}(t) = \frac{2}{\sqrt{2\pi}}\frac{\sqrt{2\pi}}{2}$$

Cancelling gives us:

$$\psi_{\left|Z\right|}(t) = e^{\frac{1}{2}t^2}$$

Then to double check my answer I take the derivative and plug in 0, expecting to get $\mathbb{E}(\left|Z\right|) = \sqrt{\frac{2}{\pi}}$.

$$\psi'_{\left|Z\right|}(t) = te^{\frac{1}{2}t^2}$$ $$\psi'_{\left|Z\right|}(0) = 0$$

Not what I expected. Where did I go wrong?

1

There are 1 best solutions below

0
On

Let the standard normal density function be $\phi(u)$ and the cumulative distribution function be $\Phi(u)$. Then the final answer is, as given in a comment, $2\Phi(t) e^{\frac12 t^2} $

To sum it up: \begin{eqnarray} M_{|U|}(t) &= \int_{-\infty}^\infty e^{t|u|} \phi(u)\; du \\ &=2 \int_0^\infty e^{t|u|} \frac1{\sqrt{2\pi}} e^{-\frac12 u^2}\;du \\ &=\frac{2}{\sqrt{2\pi}} e^{\frac12 t^2} \int_0^\infty e^{-\frac12 (u-t)^2} \; du \\ &= \frac{2}{\sqrt{2\pi}} e^{\frac12 t^2} \int_{-t}^\infty e^{-\frac12 z^2}\: dz \\ &= 2\Phi(t) e^{\frac12 t^2} \end{eqnarray}