Solution

ID: past-exam-of-the-mathematical-and-computational-biology-course-of-the-university-of-cambridge/2025/paper-1/6/g/solution

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.

New to topics? Read the docs here!