Median of X minimises $f(x)=E[|X-x|]$

200 Views Asked by At

I am trying to understand the following proof:

Let $X$ be an integer-valued random variable on a discrete probability space with finite expected value.

Prove that the minimum of $$f:\mathbb R \to \mathbb R$$ $$f(x) = E[|X-x|]$$

is the Median of the probability distribution of X.

Proof.

We have $$\sum_{x\in X(\Omega)}|x-a|p_x(x)=\sum_{x\in X(\Omega),x\le a}(a-x)p_x(x)+\sum_{x\in X(\Omega),x\ge a}(x-a)p_x(x)<\infty$$ since$$E[X]=\sum_{\omega\in \Omega}X(\omega)p_x(\omega)<\infty$$ Hence, according the the transformation theorem we have $$f(a)=E[|X-a|]=\sum_{x\in X(\Omega)}|x-a|p_x(x)=\sum_{x\in X(\Omega),x\le a}(a-x)p_x(x)+\sum_{x\in X(\Omega),x\ge a}(x-a)p_x(x)$$ Let $0<\epsilon<<1.$ Then: $$f(a+\epsilon)=f(a)+\epsilon P(X\le a)-\epsilon P(X\ge a) $$

Hence, changing a cannot reduce $f(a)$ only if $P(X \le a)$ = $P(X \ge a)$.

What I don't get here is the last argument: $f(a+\epsilon)=f(a)+\epsilon P(X\le a)-\epsilon P(X\ge a) $ implies that a minimum of f $<=>$ a median of X.

Any help is greatly appreciated!

1

There are 1 best solutions below

0
On BEST ANSWER

If $a$ is changed by a small amount $\epsilon$, then $f(a)$ changes by $\epsilon [\Bbb{P}(X \leq a) - \Bbb{P}(X \geq a)]$. But if $f(a)$ is the minimum value of $f$, then when $a$ is changed by a tiny amount, $f(a)$ shouldn't change at all, as it is a local minimum. So, $\Bbb{P}(X \leq a) =\Bbb{P}(X \geq a)$, and $a$ is the median.