Math 2.0

Numerical analysis Monte Carlo and quasi-Monte Carlo methods Theorem

Rejection sampling

Builds on Probability density functionContinuous uniform distributionConditional probabilityGeometric distribution

Statement

Let ff and gg be probability density functions on ℝd\R^d, and let M≥1M \ge 1 be a constant with f(x)≤Mg(x)f(x) \le M g(x) for all xx. Let (Y1,V1),(Y2,V2),…(Y_1, V_1), (Y_2, V_2), \ldots be independent pairs, where YjY_j has density gg, VjV_j has the uniform distribution on (0,1)(0, 1), and YjY_j and VjV_j are independent. Call trial jj accepted if g(Yj)>0g(Y_j) > 0 and Vj≤f(Yj)/(Mg(Yj))V_j \le f(Y_j) / (M g(Y_j)). Let τ\tau be the index of the first accepted trial and X=YτX = Y_\tau. Then:

  1. each trial is accepted with probability 1/M1/M;
  2. the conditional distribution of YjY_j given that trial jj is accepted has density ff;
  3. τ\tau is finite almost surely, has the geometric distribution with success probability 1/M1/M, so 𝔼τ=M\mathbb E\tau = M, and XX has density ff.

Remarks

For a measurable set AA, P(Yj∈A, accepted)=∫Ag(y)f(y)Mg(y) dy=1M∫Af(y) dyP(Y_j \in A,\ \text{accepted}) = \int_A g(y) \frac{f(y)}{M g(y)}\, dy = \frac{1}{M} \int_A f(y)\, dy, where the integral runs over the points with g>0g > 0, which carry all the mass of ff since f≤Mgf \le M g. Taking A=ℝdA = \R^d gives clause 1, and dividing by 1/M1/M gives clause 2. Clause 3 follows because the trials are independent and XX is the value of the first success. Example: to sample the density f(x)=2xf(x) = 2x on [0,1][0, 1], take g=1g = 1 on [0,1][0, 1] and M=2M = 2; a uniform YY is accepted when V≤YV \le Y, which happens half the time. The bound f≤Mgf \le M g is necessary: if f>Mgf > M g on a set of positive measure, the accepted values follow the density proportional to min⁡(f,Mg)\min(f, M g), not ff. The method needs ff only up to a constant factor: if f=cf~f = c \tilde f with unknown cc, one uses f~≤M~g\tilde f \le \tilde M g and the acceptance test V≤f~(Y)/(M~g(Y))V \le \tilde f(Y)/(\tilde M g(Y)).

Going deeper

For a student

Rejection sampling, due to von Neumann, is exact, needs no inverse distribution function, and works in any dimension. Its weakness is the acceptance rate 1/M1/M, which typically decays exponentially with the dimension, so in high dimension Markov chain Monte Carlo is used instead. Many fast samplers are refinements of it. The ziggurat algorithm uses a cheap envelope made of rectangles. Adaptive rejection sampling builds the envelope from tangent lines of log⁡f\log f when ff is log-concave. The number of trials before acceptance is geometric, so the cost per sample is random but with all moments finite.

Reading path

To understand this page from the ground up, read these 5 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Conditional probability concept
  2. Continuous uniform distribution concept
  3. Geometric distribution concept
  4. Probability density function concept
  5. Rejection sampling statement

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Rejection_sampling
About this page
TagR1QBNFTHFP
URIm2://R1QBNFTHFP
Kindstatement, theorem
WritingW0 stub
MSC65C10, 65C05
StatusThis copy of the site has no build data. Run m2 status R1QBNFTHFP.
AboutProbability density function
UsesProbability density function, Continuous uniform distribution, Conditional probability, Geometric distribution
Same as

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

Results about this

Used by