0
$\begingroup$

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

1 Answers 1

1

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.

  • 0
    but why $y$ should be the median of $X$ and how to solve this integral?2012-05-30
  • 0
    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.2012-05-30
  • 0
    the density function is just a general density function without any concrete form.2012-05-30
  • 0
    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$.2012-05-30
  • 0
    the proof u linked here i have read, but a quest that do u think the derivation of his integral is right? because the integrated region is from minus infinity to positive infinity how can he derivate like that?ps: in the 4th line of the 3rd answerof your linked proof2012-05-30
  • 0
    i mean in this equation \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?2012-05-30
  • 0
    That's a special differentiation technique discussed in advanced calculus courses, and in a Wikipedia article, under a title like "differentiation under the integral sign." The calculation looks right to me. The answer by did proves the same result under much weaker conditions on the random variable $X$.2012-05-30
  • 0
    i dont think it is right, as the calculation should like this2012-05-30