1

Let $X \in L^1.$ I need to characterize the minimizer of the function: $$ d(x) = \mathbb{E} [|X-x|], \,\, x\in \mathbb{R}.$$ Let m be the minimizer we are looking for. Then for $x\leq m$ (and eventually for $x \geq m$) , I want to show the following,$\,\,d(m) -d(x)\leq (m-x) (\mathbb{P} (X< m) -\mathbb{P} (X \geq m)) $ : $$d(m) -d(x) = \mathbb{E} [|X-m|] - \mathbb{E} [|X-x|] \leq \int_{\mathbb{R}} X^{+} + X^{-} + |m|\,\,\, d \mathbb{P} \,\,- \int_{\mathbb{R}} X^{+} + X^{-} + |x|\,\,\, d \mathbb{P} = (|m|-|x|) \int_{\mathbb{R}} \,\,\, d \mathbb{P}.$$

Since $m$ is a minimizer, $d(m)-d(x)\leq 0.\,\,$ I am not sure how I can go from here.

Can somebody provide some support or a solution proposal ? Thanks.

copper.hat
  • 172,524
  • 1
    $ x $ would be the median of $ X $. Are you sure of the identity? Because for continuous distributions the RHS would be $0$ as $ P(X < m) = P(X \ge m) = 0.5 $. – joy Dec 24 '21 at 19:21
  • Thanks. You mean the inequality that I am trying to show ? If this is the case, yes. It was given as a hint. Can you provide any suggestion to prove the inequality ? – user996159 Dec 24 '21 at 19:23
  • 1
    Yes it is indeed right. See this answer – joy Dec 24 '21 at 19:32
  • Thanks. I will look at that. Can you tell me if the two RHS of the equality I was developing are correct ? – user996159 Dec 24 '21 at 19:41
  • You have not properly enclosed the terms in brackets, I presume. $ \int_{\mathbb{R}} X^+ + X^- - m d\mathbb{P} - \int_{\mathbb{R}} X^+ + X^- - x d\mathbb{P} $ does not quite make sense. – joy Dec 24 '21 at 19:50
  • What is the correct expression of that difference of the expectations ? I changed it little bit. Is it now correct ? – user996159 Dec 24 '21 at 20:03
  • 1
    A cheap way is to note that the subgradient is $\partial d(x) = - E [\operatorname{sgn}(X-x)]$. – copper.hat Dec 24 '21 at 20:18
  • Thanks. I can not understand the relationship of that identity with the one I want to prove. – user996159 Dec 24 '21 at 20:24
  • At a minimiser you will have $0 \in \partial d(x)$. – copper.hat Dec 24 '21 at 21:33
  • @user996159 $ \mathbb{E}[| X - m |] = \int_\mathbb{R} (X - m)^+ d\mathbb{P} + \int_\mathbb{R} (X - m)^- d\mathbb{P} $ and $ \mathbb{E}[| X - x |] = \int_\mathbb{R} (X - x)^+ d\mathbb{P} + \int_\mathbb{R} (X - x)^- d\mathbb{P} $ are the correct expressions. How did you arrive at your expressions? – joy Dec 25 '21 at 14:42

2 Answers2

2

Let $\phi(x) = \int |x-X| dP = \int g_X(x) dP$. Note that $\phi$ is defined everywhere, convex and $\phi(x) \to \infty$ as $|x| \to \infty$. In particular, $\phi$ has a minimiser.

Write $[X \le x]$ for $\{ \omega | X(\omega) \le x \}$, etc. For a function $\phi$ denote the one sided directional derivative at $x$ in the direction $h$ as $d \phi(x;h)$.

Fix some $\alpha$ and let $g_\alpha(x) = |x-\alpha|$. Note that $d g_\alpha (x;+1) = \begin{cases} +1, & x \ge \alpha\\ -1, & \text{otherwise} \end{cases}$, and $d g_\alpha (x;-1) = \begin{cases} +1, & x \le \alpha\\ -1, & \text{otherwise} \end{cases}$.

Note that the directional derivative of $g_\alpha$ is defined everywhere.

Let $l=P[X<x], e=P[X=x], g=P[X>x]$.

An application of the dominated convergence theorem shows that with $h =\pm 1$ we have $d \phi(x; h) = \int dg_X(x;h) dP$ from which we get $d \phi(x; +1) = l+e-g$, $d \phi(x; -1) = g+e-l$.

Since $\phi$ is convex, we have $x^*$ is a minimiser iff $d \phi(x^*,+1) \ge 0$ and $d \phi(x^*,-1) \ge 0$.

Hence $x$ is a minimiser of $\phi$ iff $l+e \ge g$ and $g+e \ge l$. Combining with $l+e+g = 1$ this gives $l+e \ge {1 \over 2}$, $g+e \ge {1 \over 2}$.

Now suppose $l+e \ge {1 \over 2}$, $g+e \ge {1 \over 2}$, then from $l+e+g = 1$ we get ${1 \over 2} \ge g$ and ${1 \over 2} \ge l$ and so $l+e \ge g$ and $g+e \ge l$.

In particular, we see that $x$ is a minimiser iff $P[X \le x] \ge {1 \over 2}$ and $P[X \ge x] \ge {1 \over 2}$.

This is the definition of the median (see https://en.wikipedia.org/wiki/Median#Probability_distributions).

copper.hat
  • 172,524
  • $P[X\le x]\ge\frac12,\land,P[X\ge x]\ge\frac12$ turns out to be exactly the same as $\mu(-\infty,c)\le\frac12\le\mu(-\infty,c]$, which is what I got. – robjohn Feb 19 '22 at 23:33
0

$\newcommand{\sgn}{\operatorname{sgn}}$ Note that $$ |x-c|=\int_c^x\sgn(x-t)\,\mathrm{d}t\tag1 $$ Thus, for $b\gt a$, $$ \begin{align} &\int_{-\infty}^\infty|x-b|\,\mathrm{d}\mu(x)-\int_{-\infty}^\infty|x-a|\,\mathrm{d}\mu(x)\tag{2a}\\ &=\int_{-\infty}^\infty\int_b^x\sgn(x-t)\,\mathrm{d}t\,\mathrm{d}\mu(x)-\int_{-\infty}^\infty\int_a^x\sgn(x-t)\,\mathrm{d}t\,\mathrm{d}\mu(x)\tag{2b}\\ &=-\int_{-\infty}^\infty\int_a^b\sgn(x-t)\,\mathrm{d}t\,\mathrm{d}\mu(x)\tag{2c}\\ &=-\int_a^b\int_{-\infty}^\infty\sgn(x-t)\,\mathrm{d}\mu(x)\,\mathrm{d}t\tag{2d}\\ &=\int_a^b(\mu(-\infty,t)+\mu(-\infty,t]-1)\,\mathrm{d}t\tag{2e} \end{align} $$ Explanation:
$\text{(2b)}$: integrate $(1)$ against $\mathrm{d}\mu$
$\text{(2c)}$: $\int_b^xf(t)\,\mathrm{d}t-\int_a^xf(t)\,\mathrm{d}t=-\int_a^bf(t)\,\mathrm{d}t$
$\text{(2d)}$: Fubini's Theorem
$\text{(2e)}$: $\sgn(x-t)=1-[x\le t]-[x\lt t]\qquad$ (Iverson brackets)

Therefore, if $\mu(-\infty,b)+\mu(-\infty,b]\le1$, then $$ \int_{-\infty}^\infty|x-b|\,\mathrm{d}\mu(x)-\int_{-\infty}^\infty|x-a|\,\mathrm{d}\mu(x)\le0\tag{3a} $$ That is, $\int_{-\infty}^\infty|x-c|\,\mathrm{d}\mu(x)$ is decreasing when $\mu(-\infty,c)+\mu(-\infty,c]\le1$.

Furthermore, if $\mu(-\infty,a)+\mu(-\infty,a]\ge1$, then $$ \int_{-\infty}^\infty|x-b|\,\mathrm{d}\mu(x)-\int_{-\infty}^\infty|x-a|\,\mathrm{d}\mu(x)\ge0\tag{3b} $$ That is, $\int_{-\infty}^\infty|x-c|\,\mathrm{d}\mu(x)$ is increasing when $\mu(-\infty,c)+\mu(-\infty,c]\ge1$.

Thus, $\int_{-\infty}^\infty|x-c|\,\mathrm{d}\mu(x)$ is minimized when $\mu(-\infty,c)\le\frac12\le\mu(-\infty,c]$.

robjohn
  • 345,667