acceptance-rejection method
The acceptance-rejection methodis an algorithm for generating random samples froman arbitrary probability distribution, givenas ingredients random samples from a related distribution and theuniform distribution
.
The acceptance-rejection method’s chief advantage over the inverse CDFmethod of generating random numbers
is that it requires neither the cumulative distribution function
nor its inverse to be computed. So in many cases it can run faster.
Set-up
- •
Let be a random variable
with some other probability distributionthat we know how to draw samples from — that is, generate on a computer.
- •
Let be a random variable uniformly distributed on the interval .
- •
Let be the random variable that we want to be able to generate.Assume has a probability distribution thatis absolutely continuous
to the probability distribution for ,with density .
- •
Further assume that the density is bounded above bya constant .So for all in the range of ;and necessarily .
In most applications, both and will be continuous random variableswith densities and respectively.In that case we have ,and we require .
(If , then set .Note that we cannot have and simultaneouslyon a set of positive measure, since has a distributionabsolutely continuous with respect to that of .)
The random variables and can be multi-variate.
Algorithm
The procedure to generate a value for is:
- 1.
Generate a value for .
- 2.
Generate a value for .
- 3.
If , then set (“accept”).
- 4.
Otherwise, go back to step 1 (“reject”),repeating until we obtain a value of in step 3.
Intuitive explanation
When we generate and as prescribed in the algorithm,we are in fact picking the point in the rectangular boxbelow. And the test determinesthat point lies below the graph of .It seems plausible that if we keep only the points thatfall under the graph of the density , and ignore the points above,then the distribution of the abscissashould have density .
The acceptance-rejection method works more efficientlyas the distribution of and become similar enough— that is, and its upper bound are close to one.This makes the rejection region smaller, and so the algorithmis likely to go through fewer repetitions discarding the rejects.
Justification
We now prove that the acceptance-rejection method works.
Let , for , be independentrandom variables representing the samples, all with law .Let , for ,be independent random variables, with the uniform distribution over ,and independent from .
Let
be the number of draws (for and ) taken by the algorithmbefore acceptance.Then we must show that has the correct distribution:it should be distributed with density with respect to .
We have, by independence,
We can calculate the last probability explicitly.Letting be the law of ,and using the independence of from , we find:
From the equation ,we take expectations of both sides, evaluatingthe resulting geometric series:
Thus almost surely,and the algorithm terminates, on average, after drawing samples.
Finally, for all measurable sets ,we have
as is to be shown.
References
- 1 James E. Gentle. Random Number Generation and Monte Carlo Methods,second edition. Springer, 2003.