Possible Duplicate:
Why does the median minimize $E(|X-c|)$?
Can someone tell how to calculate the $y$ of $\min E[|X-y|]$,where $X$ has a continuous density function $f(x)$?
Possible Duplicate:
Why does the median minimize $E(|X-c|)$?
Can someone tell how to calculate the $y$ of $\min E[|X-y|]$,where $X$ has a continuous density function $f(x)$?
If the expectation exists, $y$ minimizes your expression if and only if $y$ is a median of $X$.
From a calculation point of view, you are then solving $$\int_{-\infty}^y f_X(t)\,dt=\frac{1}{2},$$ where $f_X(t)$ is the density function of $X$.
Proofs can be found in many places. For example, you can find the proof of a more general result on Math Stack Exchange.
\begin{align} \frac{dJ}{dc} & = (c-x)f(x) | {x=c} + \int{-\infty}^{c} f(x) dx + (x-c)f(x) | {x=c} - \int_c^{\infty} f(x) dx\ & = \int{-\infty}^{c} f(x) dx - \int_c^{\infty} f(x) dx = 0 \end{align} is it right to say $(c-x)f(x) | _{x=c}$ and $(x-c)f(x) | _{x=c}$,how can people to get this result? – Niutouren des Jahres May 30 '12 at 19:24