1

We try to find c value minimizing E[|x-c|], "expected value of absolute deviations", for a continuous random variable X.

E[|x-c|]=Integral(-inf,inf)[|x-c|]f(x)dx =Integral(-inf,c)[-x+c]f(x)dx+Integral(c,inf)[x-c]f(x)dx

Now I want to take first derivative here, with respect to c and set it equal to 0. I know I should use the rule "If you integrate a function f and then differentiate the integral with respect to its upper endpoint (y above) you get f back again" but I think I miss the trick.

How can I proceed?

Best regards..

Ovunc
  • 11
  • 1
    Your equation defining $E[|X-c|]$ is incorrect. Once you have that fixed, bear in mind that your differentiation needs to take into account that $c$ appears in the integrand as well as in the limit. If you have forgotten this formula, see, for example, a comment following this answer. – Dilip Sarwate Sep 29 '14 at 18:03
  • I forgot to write f(x) in the integral. What I mean is: from -inf to c, integrate (-x+c)f(x) first.. then from c to inf, integrate (x-c)f(x).. What is wrong about it? – Ovunc Sep 29 '14 at 18:06
  • 1
    Your formula is correct now – Dilip Sarwate Sep 29 '14 at 18:20
  • Every median solves this. – Did Sep 29 '14 at 18:22
  • I know median solves this - but I am trying to prove it.. Basically what will happen is I end up with F(c)-(1-F(c))=0. Then I will show that minimizing c has the property of F(c)=0.5, which is the median. – Ovunc Sep 29 '14 at 18:24
  • @DilipSarwate I wonder how you take this integral. For example, for Integral(-inf,c) [cf(x)]dx.. What is the derivative of this with respect to c? – Ovunc Sep 29 '14 at 18:25
  • It is not necessary to compute the value of the integral (which value is a function of $c$) before differentiating with respect to $c$. As to what the derivative is, did you try the link I referred you to in my first comment? – Dilip Sarwate Sep 29 '14 at 18:29
  • Yes I miswrote again, then edited the comment:) I checked that, but I am not sure about the infinity - I am just confused. – Ovunc Sep 29 '14 at 18:30
  • Ok I got the part with an upper bound c.. But what happens when the upper bound is infinity? Which rule am I supposed to use? – Ovunc Sep 29 '14 at 18:42
  • I guess when upper part is infinity, derivative of integral(xf(x)dx) is 0. and derivative of integral (cf(x)dx) is equal to c0 + 1integral(c,inf)[xf(x)]dx. Thanks all – Ovunc Sep 29 '14 at 18:50

0 Answers0