Acceptance-rejection methods

Another method of generating random variates from distributions is to use acceptance-rejection methods. Basically to generate a random number from , we generate a RN from an envelope distribution , where . The acceptance-rejection algorithm is as follows:

Repeat until we generate a value from step 2:

1. Generate from and from

2. If , return (as a random deviate from ).

Example: the standard normal distribution

This example illustrates how we generate RNs using the logistic distribution as an envelope distribution. First, note that

On setting , we get . This method is fairly efficient and has an acceptance rate of

Example: the standard normal distribution with a squeeze

Suppose the density is expensive to evaluate. In this scenario we can employ an easy to compute function , where . is called a squeeze function. In this example, we’ll use a simple rectangular function, where for . This is shown in the following figure:

The modified algorithm is as follows:

Repeat until we generate a value from step 2:

1. Generate from and from

2. If or , return (as a random deviate from ).

Hence, when we don’t have to compute . Obviously, in this example isn’t that difficult to compute.