= Uniform-envelope rejection sampling for a beta distribution
{title2=$r(x)=x^{a-1}(1-x)^{b-1},\quad a,b\geq1$}
For $a,b>1$, the maximum of $r$ on $[0,1]$ occurs at $(a-1)/(a+b-2)$. If one parameter is one, the maximum is attained at the corresponding endpoint; if both are one, $r$ is constant. Let $M=\sup r$. Accept an <independent> <uniform distribution> proposal $X$ when another uniform draw is at most $r(X)/M$. The accepted <probability density function> is the <beta distribution>, and acceptance <probability> is $B(a,b)/M$.
Back to article page