Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2005/iii/paper-45/3/iv/solution
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 3 iv Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-14
Use the joint prior density as the proposal for rejection sampling. Since the Poisson probability lies in , the following algorithm is valid:
- Draw from the proper prior distribution .
- Independently draw from the exponential distributions with rates , for , and calculate .
- Draw uniformly on , independently of all previous draws. Retain if ; otherwise restart.
The joint density of a proposed pair together with its acceptance event is . Its integral is , so conditioning on acceptance gives precisely , the desired posterior density. Repeating independent proposal trials until each acceptance produces independent posterior observations. This is Bayesian rejection sampling for a segregating-site count.
An equivalent implementation simulates and accepts exactly when . Its acceptance probability is the same Poisson mass. Propose from the joint prior and accept according to the exact observed-count likelihood. No approximation to the posterior distribution is involved in the accepted draws.
New to topics? Read the docs here!