Rejection Sampling

In mathematics, rejection sampling is a basic pseudo-random number sampling technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm".

Rejection sampling is based on the observation that to sample a random variable one can sample uniformly from the region under the graph of its density function.

To visualize this motivation, imagine graphing the distribution of a random variable onto a large rectangular board and throwing darts at it. Assume that the darts are uniformly distributed around the board. Now take off (reject) all of the darts that are outside the area under the curve. The remaining darts will be distributed uniformly within the area under the curve, and the x-positions of these darts will be distributed according to the random variable's density. This is because there is the most room for the darts to land where the curve is highest and thus the probability density is greatest.

The visualization as just described is equivalent to a particular form of rejection sampling where the proposal distribution is uniform (hence its graph is a rectangle). The general form of rejection sampling assumes that the board is not necessarily rectangular but is shaped according to some distribution that we know how to sample from (e.g. using inversion sampling), and which is at least as high at every point as the distribution we want to sample from, so that the former completely encloses the latter. (Otherwise, there will be parts of the curved area we want to sample from that can never be reached.) Rejection sampling works as follows:

  1. Sample a point (an x-position) from the proposal distribution.
  2. Draw a vertical line at this x-position, up to the curve of the proposal distribution.
  3. Sample uniformly along this line (i.e. uniformly from 0 to the value of the proposal distribution), and reject points outside of the desired distribution (i.e. greater than the value of the desired distribution at this point).

Note also that this algorithm can be used to sample from the area under any curve, regardless of whether the function integrates to 1. In fact, scaling a function by a constant has no effect on the sampled x-positions. This means that the algorithm can be used to sample from a distribution whose probability density function is only known up to a constant (i.e. whose normalizing constant is unknown), which is common in computational statistics.

Read more about Rejection Sampling:  Theory, Algorithm, Examples, Drawbacks, Adaptive Rejection Sampling

Famous quotes containing the word rejection:

    He began therefore to invest the fortress of my heart by a circumvallation of distant bows and respectful looks; he then entrenched his forces in the deep caution of never uttering an unguarded word or syllable. His designs being yet covered, he played off from several quarters a large battery of compliments. But here he found a repulse from the enemy by an absolute rejection of such fulsome praise, and this forced him back again close into his former trenches.
    Sarah Fielding (1710–1768)