Direct independent sampling is preferable. The posterior distribution is the standard beta distribution , for which exact posterior moments and standard random-number generators are available. For example, draw independent and with the same rate, and return . This has the required beta distribution and avoids Markov chain Monte Carlo convergence problems. A correct, converged MCMC method could sample this target, but it is unnecessarily complicated here.
Posterior moment 2026-10-20
A posterior moment is a moment computed under a posterior distribution. Its first raw moment is the posterior mean; its second central moment is the posterior variance.