= Solution
Use <Bayesian rejection sampling for a segregating-site count>. Independently propose $\theta\sim\pi$ and $T_j\sim\operatorname{Exp}(\lambda_j)$ for $j=2,\ldots,n$, and calculate $L=\sum_jjT_j$. Draw an independent uniform $U$ on $(0,1)$ and accept the whole proposed vector exactly when
$$
\boxed{U\le e^{-\theta L/2}\frac{(\theta L/2)^k}{k!}.}
$$
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 $f(\theta,T\mid S=k)$. Independent proposals and uniforms produce independent posterior draws. Equivalently, one could simulate a count from a <Poisson distribution> with mean $\theta L/2$ and retain the proposal when that count equals $k$; the uniform version avoids simulating that extra count.
Back to article page