Density of the absolute value of a normal random variable (error in calculations)

314 Views Asked by At

Suppose that random variable $X$ is distributed as $N(0,\sigma^2)$.

We wish to find the density of $|X|$.

Let $F$ and $f$ be the cumulative distribution function and the density function of $|X|$ respectively.

Then $$ F(x) = \mathbb{P} ( -x \leq X \leq x) = \int_0^x \frac{1}{\sqrt{2 \pi} \sigma} e^{- \frac{u^2}{2\sigma^2}} \,du - \int_0^{-x} \frac{1}{\sqrt{2 \pi} \sigma} e^{- \frac{u^2}{2\sigma^2}} \,du. $$ Differentiating and applying fundamental theorem of calculus give $$ f(x) = \frac{1}{\sqrt{2 \pi} \sigma} e^{- \frac{x^2}{2\sigma^2}} - \frac{1}{\sqrt{2 \pi} \sigma} e^{- \frac{(-x)^2}{2\sigma^2}} (-1) = \frac{2}{\sqrt{2 \pi} \sigma} e^{- \frac{x^2}{2\sigma^2}}. $$ However, $$ \int_{\mathbb{R}} \frac{2}{\sqrt{2 \pi} \sigma} e^{- \frac{x^2}{2\sigma^2}} \,dx = 2,$$ so $\frac{2}{\sqrt{2 \pi} \sigma} e^{- \frac{x^2}{2\sigma^2}}$ cannot possibly be a density function.

I have checked this simple calculation many times and still cannot find the error. Any ideas?

2

There are 2 best solutions below

0
On BEST ANSWER

Note that

$$F(x) = \mathbb{P} ( -x \leq X \leq x)$$

with $x\in[0,+\infty)$ and

$$\int_{\color{red}{\mathbb{R^+}}} \frac{2}{\sqrt{2 \pi} \sigma} e^{- \frac{x^2}{2\sigma^2}} \,dx = 1$$

0
On

The integral is over $\mathbb{R}^+$ only: $|x|$ can take only positive values.