Solution (source code)

= Solution

The <Rao-Blackwell theorem> applies to an <estimator> $Y$ with finite second moment and a <sufficient statistic> $T$. The conditional <estimator> $Y^*=\mathbb E_\theta[Y\mid T]$ can be chosen as a function of the observed $T$ that does not depend on the unknown parameter: this uses the parameter-independent conditional data distribution in the definition of <sufficient statistic>. The <tower property of conditional expectation> gives $\mathbb E_\theta Y^*=\mathbb E_\theta Y$, so their <bias> agrees. The <law of total variance> gives
$$
\operatorname{Var}_\theta Y=\operatorname{Var}_\theta Y^*+\mathbb E_\theta\operatorname{Var}_\theta(Y\mid T).
$$
For any target $a(\theta)$ it follows that
$$
\boxed{\mathbb E_\theta[(Y^*-a(\theta))^2]\le\mathbb E_\theta[(Y-a(\theta))^2]}.
$$
Equality holds exactly when $Y=Y^*$ almost surely under that parameter value. This proves variance reduction and reduction of <mean squared error>, whether or not the original <estimator> is an <unbiased estimator>. More generally, <conditional Jensen inequality> proves the corresponding inequality for any convex loss in the estimate, whenever the expectations exist.