Expected value of $|X|$ when $X$ is random Gaussian

85 Views Asked by At

Assume $X$ is a Gaussian random variable with pdf: $$f_X(x)=\frac{1}{\sigma \sqrt{2 \pi}} \exp \left( -\frac{1}{2} \left(\frac{x-\mu}{\sigma}\right)^2 \right) $$ and let $Y=|X|$. Now $Y$ is not Gaussian and, as far as I know, the pdf of $Y$ is given by: $$f_Y(y)=\begin{cases} \frac{2}{\sigma \sqrt{2 \pi}} \exp \left( -\frac{1}{2} \left(\frac{y-\mu}{\sigma}\right)^2 \right), \, if \,\,y \ge 0\\ 0, \, otherwise \end{cases}$$ Trying to calculate the expected value of $Y$ by the usual way: $$E(Y)=\int_{0}^{+\infty} y \,f_Y(y) \,dy$$ I find: $$E(Y)=\mu + \sigma \,\sqrt{\frac{2}{\pi}}$$ I'm not going to try to detail the calculations (if you allow me), but can you just tell me if this result is the correct one?

1

There are 1 best solutions below

3
On BEST ANSWER

Your calculation of $E(Y)$ is incorrect because you've got the wrong density for $Y$. To calculate $E(|X|)$ you can work with the density of $X$ directly: $$ E|X|=\int _{-\infty}^\infty |x| f_X(x)\,dx $$ and then break this integral into two cases $x<0$ and $x>0$. When $x>0$ you've got the integral $$\int_0^\infty xf_X(x)\,dx $$

When $x<0$, the integral you seek is $$ \int_{-\infty}^0 (-x)f_X(x)\,dx $$ which you can handle by the substitution $t:=-x$.


EDIT: To obtain the density $f_Y(y)$, notice that the answer https://math.stackexchange.com/a/2485173/215011 is assuming $\mu=0$ and $\sigma=1$. If you want to follow the approach in that calculation, you'd expand $P(-x<X\le x)$ differently: $$\begin{aligned}P(-x<X\le x)& = P(X\le x) - P(X\le -x) \\&= P\left(\frac{X-\mu}\sigma \le \frac {x-\mu}\sigma\right)-P\left(\frac{X-\mu}\sigma\le\frac{-x-\mu}\sigma\right)\\ &= \Phi\left( \frac {x-\mu}\sigma\right)-\Phi\left(\frac{-x-\mu}\sigma\right) \end{aligned} $$ and differentiate that wrt $x$.