$X$ follows normal distribution of $N(\mu,1)$,find the expectation of $|x-\mu|$

89 Views Asked by At

$X$ follows normal distribution of $N(\mu,1)$,find the expectation of $|x-\mu|$

What I did is: $E(|X-\mu|)=E(-X+\mu)P(X<\mu)+E(X-\mu)P(X>\mu)=\frac{1}{2}(E(-X+\mu)+E(X-\mu))=0$

I have no idea why I'm wrong, any help will be appreciated.

1

There are 1 best solutions below

1
On BEST ANSWER

The equation should be written as: $$\begin{align*} \operatorname{E}[|X-\mu|] &= \operatorname{E}[-X + \mu \mid X \le \mu]\Pr[X \le \mu] + \operatorname{E}[X - \mu \mid X > \mu]\Pr[X > \mu] \\ &= \frac{1}{2}\left(\operatorname{E}[X \mid X > \mu] - \operatorname{E}[X \mid X \le \mu]\right). \end{align*}$$ By leaving out the condition in the expectation, you're still only looking at unconditional expectations, hence the resulting incorrect cancellation.

Now, with a location transformation of $X$ to standardize it, it should be a lot easier to write instead $$\operatorname{E}[|X-\mu|] = \operatorname{E}[|Z|], \quad Z \sim \operatorname{Normal}(0,1),$$ and this is quite easy to compute in closed form, since $$\operatorname{E}[|Z|] = \int_{x=-\infty}^\infty |x| \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx = \frac{2}{\sqrt{2\pi}} \int_{x=0}^\infty xe^{-x^2/2} \, dx,$$ and this integrand yields readily to the substitution $u = x^2/2$, $du = x \, dx$.