Minimizing MMSE over positive random variables Let X be a random variable with a finite second moment. We know that:
Argmin E(X-Y)^2 = E(X|g),
Where the minimum is taken over all g-measurable random variables Y. 
How can I find argmin E(X-Y)^2 over all positive g-measurable random variable Y?
Thanks in advance!!
 A: I will give a non-rigorous result which may be true under suitable regularity conditions. I'll let someone else fix this up and try to make it rigorous and worry about the measurability jazz. So please treat the answer in that spirit, and don't downvote based on lack of rigor.
For convenience, I will let $EX$ mean $E(X|g)$.
I will interpret the requirement that $Y$ be positive as meaning that it is a.s. non-negative, i.e. could be $0$.
Assume we have sufficient regularity conditions (such as almost sure differentiability of the integrand and an apprpriate Lipschitz condition) to interchange differentiation and expectation (integration), so that we can analyze (optimize) on a sample by sample basis, so to speak.
The problem has now been reduced to min {w.r.t. $Y$} $E(X - Y)^2$, subject to $Y \ge 0$, where $Y$ can be treated as a deterministic scalar variable.  We can now apply the Karush-Kuhn-Tucker conditions to find necessary conditions for the minimum, and these conditions are also sufficient by convexity. These are:
$$-2(EX - Y) \ge 0$$
$$Y(-2(EX - Y)) = 0$$
$$Y \ge 0$$
This reduces to
$$ Y \ge EX$$
$$ Y EX = Y^2$$
$$Y \ge 0$$
from which we can conclude $Y = EX$ if $EX \ge 0$, and $Y = 0$ if $EX \lt 0$. This of course seems like an obvious answer in retrospect, without going through all this rigamarole.
We could replace nonegativity on $Y$ by strict positivity if necessary by changing this form a minimization to an infimum problem.
