Treat the supplied uniform variates as independent draws, as required for Monte Carlo simulation. Use of them and return
Each indicator has a Bernoulli distribution of parameter , and the indicators are independent. For any subset of successes the probability is ; there are such subsets. Thus , the binomial distribution. The construction includes the cases and .
For rate , return
For , , so has the exponential distribution of rate . This is inverse transform sampling; using is equivalent. Uniform draws at exact endpoints can be excluded, since those events have probability zero under the ideal continuous law.
Use uniform-envelope rejection sampling for a beta distribution. Put for and choose . For , differentiation of gives the mode , so
If or , take ; this also covers . Draw and accept it if
Otherwise continue with the next independent pair. The probability of acceptance is , so the procedure terminates almost surely. Conditional on acceptance, the probability density function is proportional to , hence is exactly the beta distribution of parameters . The restriction guarantees the bounded uniform envelope.
For , use the unnormalized normal shape . The ratio-of-uniforms method samples uniformly from
Its boundary is . The largest possible occurs at and equals , giving the normal ratio-of-uniforms envelope , .
Use independent uniform pairs to propose and . Accept precisely when
To verify its distribution, change coordinates from to , with and Jacobian determinant . The accepted point is uniform on , and the marginal probability density function of is proportional to
Thus the result is . The region has positive finite area , and the acceptance probability is . The case requires simply returning zero.

Articles by others on the same topic (0)

There are currently no matching articles.