moment generating function for folded/absolute normal distribution

3.4k Views Asked by At

So I'm using a the normal folded distribution:

$f(x) = \frac2 {\sqrt{2 \pi}}e^\frac{-x^2}{2} $

I've looked up various methods of calculating the moments of this function and they all seem really complicated.

I need to calculate the mean and variance and I thought, why not just use a moment generating function. If anyone could tell me when and where there is a mistake in my following solution please let me know.

$M_x(t) = \int e^{tx}f(x)dx$

$ = \int e^{tx}e^-{\frac{x^2}2}\frac2 {\sqrt{2 \pi}}dx$

$ = \frac2 {\sqrt{2 \pi}} \int e^{tx-x^2/2}dx$

Now we can complete the square for $tx-\frac{x^2}{2}$ for which we get:

$tx-\frac{x^2}{2} = \frac {-1}{2}(x-t)^2+ \frac {t^2}{2}$

So we can remove some constants from the equation and write the integral as

$2e^{{t^2}/2} \int \frac {e^{{-(x-t)}^2/2}}{ \sqrt{2\pi}}$

So under the integral sign we have a normal distribution with $\mu = t$ and $\sigma = 1$

Since we know that this must integrate to 1 we are left with:

$M_x(t) = 2e^{{t^2}/2}$

Any problems with this and let me know, otherwise I feel that this is a much simpler way to calculate moments than anything else I have seen so far.

1

There are 1 best solutions below

0
On

Recall that: $$ \int_{0}^{+\infty} x^{\alpha} e^{-x}\,dx = \Gamma(\alpha+1) $$ and use that fact together with a suitable substitution to prove that: $$ \int_{0}^{+\infty}\frac{2x}{\sqrt{2\pi}}e^{-x^2/2}\,dx = \sqrt{\frac{2}{\pi}},\qquad \int_{0}^{+\infty}\frac{2x^2}{\sqrt{2\pi}}e^{-x^2/2}\,dx = 1.$$