1
$\begingroup$

I need to find the expectation for |X|, E(|X|) for a normally distributed variable with parameters, $\mu$, $\sigma^2$. I've setup the integral that I think is necessary, but I'm having trouble evaluating it. Here's what I have so far:

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

Any help on how to evaluate this would be appreciated, thanks in advance.

  • 2
    Can you do it when $\mu=0$?2017-01-25
  • 0
    No, the parameters must stay as $\mu , \sigma^2$2017-01-25
  • 1
    You misunderstand me. I'm asking whether you are able to do the particular case of the problem with $\mu=0$. I'm not claiming that doing so would be sufficient to solve the general case. But if you could do the problem with $\mu=0$ and write it in your question, then we could help you with just the issue of generalizing to $\mu \neq 0$. This would match up better with our attitude towards questions on this site.2017-01-25
  • 0
    Yes, if $\mu = 0$ that would simplify the integrals, my main issue now is that I don't know how to evaluate these integrals using the normal cdf function. I know that my answer will involve $\Phi$ but i'm not sure how to change the integrals I have into some version of $\Phi$.2017-01-25

1 Answers 1

2

It is preferable to standardize $X$ and consider the expectation of the transformed variable. Specifically, we note $$X = \sigma Z + \mu, \quad Z \sim \operatorname{Normal}(0,1).$$ Thus $$\operatorname{E}[|X|] = \operatorname{E}[|\sigma Z + \mu|] = \sigma \operatorname{E}[|Z + \mu/\sigma|].$$ What this shows is that we should consider the cases $$Z < -\mu/\sigma, \quad Z \ge -\mu/\sigma,$$ and for convenience, let us define $m = -\mu/\sigma$. Then $$\begin{align*} \operatorname{E}[|X|] &= \frac{\sigma}{\sqrt{2\pi}} \left( \int_{z=-\infty}^m -(z+m) e^{-z^2/2} \, dz + \int_{z=m}^\infty (z+m) e^{-z^2/2} \, dz \right) \\ &= \frac{\sigma}{\sqrt{2\pi}} \left( 2e^{-m^2/2} + m \int_{z=m}^\infty e^{-z^2/2} \, dz - m \int_{z=-\infty}^m e^{-z^2/2} \, dz \right) \\ &= \sigma e^{-m^2/2}\sqrt{\frac{2}{\pi}} + \mu \int_{z=m}^\infty f_Z(z) \, dz - \mu \int_{z=-\infty}^m f_Z(z) \, dz \\ &= \sigma e^{-\mu^2/(2\sigma^2)}\sqrt{\frac{2}{\pi}} + \mu (1 - 2 \Phi(-\mu/\sigma)). \end{align*}$$