Importance sampling of a Cauchy tail (source code)

= Importance sampling of a Cauchy tail
{title2=$Y=2/(1-U),\quad W=Y^2/[2\pi(1+Y^2)]$}

For $U$ uniform on $(0,1)$, $Y$ has density $q(y)=2y^{-2}$ on $y\ge2$. The <importance sampling> weight for the standard <Cauchy distribution> tail is $W=f(Y)/q(Y)$, and its expectation is the target tail <probability>. Writing $A=\arctan(1/2)$ gives $\mathbb EW=A/\pi$ and $\mathbb EW^2=(A+2/5)/(4\pi^2)$ by integrating $y^2/(1+y^2)^2$. The weight varies only between $2/(5\pi)$ and $1/(2\pi)$, making its <variance> much smaller than that of a rare-event indicator. This is a comparison of sampling <variances>, not a deterministic ordering of every pair of empirical <variance> estimates.