1

Assume that $X$ and $Y$ are random varaibles. The theory of conditional expectation says that the function f that minimizes $E[(Y-f(X))^2]$ is $f(x)=E[Y|X=x]$.

My book says that the function that minimizes $E[|Y-f(X)|]$ is $f(x)=\text{median}(Y|X=x)$. But how do we show this last result? Does it follow from the theory of conditional expectation?

user394334
  • 1,230

1 Answers1

1

Note that minimizing $\mathsf{E}[|Y-f(X)|\mid X=x]$ yields $m(x):=\operatorname{med}(Y\mid X=x)$ (see this question). Thus, for any measurable function $f$, $$ \mathsf{E}[\mathsf{E}[|Y-m(X)|\mid X]]\le \mathsf{E}[\mathsf{E}[|Y-f(X)|\mid X]]. $$