The Gibbs sampler to sample from this distribution is given in Algorithm 2 . Note that in Line 8 we employ rejection sampling in which sufficient statistics are sampled until the values drawn are valid for the given data model , e.g. , s must be positive for the binomial distribution . The RS - CLT algorithm to compute parameters of the random sum CLT is shown in Algorithm 3 .