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.
Use Bayesian rejection sampling for a segregating-site count. Independently propose and for , and calculate . Draw an independent uniform on and accept the whole proposed vector exactly when
Repeat after a rejection. The right side is a probability mass function value of a Poisson distribution and is therefore between zero and one. On acceptance, the probability density function of a proposed vector is its prior density multiplied by this acceptance probability, divided by the probability of acceptance. Part (c) shows that this is precisely . Independent proposals and uniforms produce independent posterior draws. Equivalently, one could simulate a count from a Poisson distribution with mean and retain the proposal when that count equals ; the uniform version avoids simulating that extra count.