= Normal rejection sampling with an exponential envelope
{title2=$M(\lambda)=\sqrt{2/\pi}\,e^{\lambda^2/2}/\lambda$}
For the <half-normal distribution>, the density ratio to $\operatorname{Exp}(\lambda)$ is maximized at $y=\lambda$. Completing the square gives the envelope constant above and acceptance <probability> $e^{-(y-\lambda)^2/2}$. Its logarithmic derivative is $\lambda-1/\lambda$, so the optimal rate is $\lambda=1$. Give an accepted nonnegative value an independent fair sign to obtain the <standard normal distribution>. The expected number of proposals is $M$, while the <probability> of rejecting one proposal is $1-1/M$; these are different quantities.
Back to article page