Cauchy tail control variate on a bounded interval (source code)

= Cauchy tail control variate on a bounded interval
{c}
{title2=$\beta_* =\operatorname{Cov}(g(Y),H(Y))/\operatorname{Var}(H(Y))$}

For $Y$ uniform on $(0,2)$, put $g(y)=1/(\pi(1+y^2))$ and $H(y)=y^2-4/3$. Then $\mathbb EH=0$, and $1/2-2\overline{g-\beta H}$ estimates the standard <Cauchy distribution> probability above two. Its variance is $4\operatorname{Var}(g-\beta H)/n$, minimized by the displayed coefficient. Here $\operatorname{Var}(H)=64/45$ and $\operatorname{Cov}(g,H)=1/\pi-7\arctan(2)/(6\pi)$, so the optimal coefficient is negative. A coefficient estimated using a separate pilot can be fixed for a fresh unbiased production sample.