# minimum of absolute value

If we consider the following problem $$\mathbb{E}[(Y-y)^2 | X=x]$$ I can easily show that the minimum with respect to $y$ occurs at $$y=\mathbb{E}[Y |X=x]$$ How can I find the minimum of $$\mathbb{E}[|Y-y| | X=x]$$ with respect to $y$? Since absolute value is not differentiable, I couldn't do the minimization.

-

It is enough to solve $\displaystyle \min_y E|Y-y|$. Assume that $Y$ has a continuous density $f(y)$ (w.r.t. Lebesgue measure). You can write \begin{align*} E|Y - y| = \int_{-\infty}^\infty |z-y| f(z) dz = \int_{-\infty}^y (y-z) f(z) dz + \int_y^\infty (z-y) f(z) dz \end{align*} The two integrals on the right-hand side are differentiable. (Hint: fundamental theorem of calculus.)