# Position of a minimum function [duplicate]

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)$?

-

## marked as duplicate by Did, t.b., mixedmath♦, Nate Eldredge, Zev ChonolesJun 1 '12 at 20:48

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$.
but why $y$ should be the median of $X$ and how to solve this integral? – Niutouren des Jahres May 30 '12 at 18:29
I have added a reference to a proof. As for computing the median (if it is unique), that can be difficult. Even when we can integrate the density function explicitly, we may need a numerical method to solve $F_X(y)=1/2$. If you have an explicit type of density function in mind, you could ask about how to calculate its median. – André Nicolas May 30 '12 at 18:37
Then I think there is no simple explicit expression involving just the density function $f$, and one cannot say much more about the median than was given in the answer. If $f$ is symmetric about some number $c$, then the answer is simple, it is $c$. – André Nicolas May 30 '12 at 18:53