Reciprocal-root inverse Gaussian sampler
= Reciprocal-root inverse Gaussian sampler
{title2=$h(x)=\frac{\lambda(x-\mu)^2}{\mu^2x}$}
For a chi-squared-one variable $Y$, the positive inverse branches of $h(x)=\lambda(x-\mu)^2/(\mu^2x)$ have product $\mu^2$. Weight a branch value $x$ by $\mu/(\mu+x)$; the two weights sum to one. Multiplying the chi-squared density by this weight and the branch Jacobian gives the inverse Gaussian density on both sides of $\mu$.