Statistics & Probability / Inverse & Rejection Sampling
FREE TO EXPLORE
LABORATORY 22 · STATISTICS & PROBABILITY

Inverse & Rejection Sampling theory

Understand inverse & rejection sampling: probability distributions, theorems, estimation laws, and hypothesis tests.

Probabilistic foundations of Inverse & Rejection Sampling.

Pseudo-random variate generation is the operational backbone of computational statistics, stochastic modeling, and Monte Carlo simulation. While the Inverse Transform method provides an exact, zero-rejection framework for analytically invertible cumulative distributions, John von Neumann's Acceptance-Rejection algorithm provides a universal mechanism for sampling from complex, non-invertible target distributions using majorizing envelopes. In this laboratory, we implement inverse transform sampling, construct optimal acceptance-rejection envelopes, analyze geometric proposal overhead, and confirm the bounding constant scaling slope m = 1.500. In mathematical statistics, empirical data science, and modern computational engineering, understanding the asymptotic sampling properties and theoretical behavior of Pseudo-Random Number Generation: Inverse Transform and Acceptance-Rejection Sampling provides crucial guarantees. Rigorous experimental validation connects foundational probability laws with observable empirical phenomena, ensuring that statistical inference remains valid under finite sample sizes and real-world data collection constraints.

y = 1.5000 · x

Viva voce questions & analytical theory

What is the theoretical principle behind the Inverse Transform method?

The Inverse Transform method (Probability Integral Transform) states that if X is a continuous random variable with strictly increasing cumulative distribution function F(x), then U = F(X) is uniformly distributed on [0, 1]. Inversely, if U ~ Uniform(0, 1), then X = F^(-1)(U) has exact cumulative distribution function F. The proof is immediate: P(X ≤ x) = P(F^(-1)(U) ≤ x) = P(U ≤ F(x)) = F(x). The method is universally exact and achieves 100% computational efficiency with zero rejected draws, but requires that F^(-1) exist in closed analytical or rapidly computable numerical form.

How does John von Neumann's Acceptance-Rejection sampling algorithm operate?

Introduced by John von Neumann in 1951, Acceptance-Rejection sampling generates variates from a target distribution with density f(x) using an accessible proposal distribution with density g(x). A bounding constant c is chosen such that f(x) ≤ c g(x) for all x in the support, so that c g(x) forms a majorizing envelope over f(x). The algorithm proceeds in two steps: (1) Generate candidate Y ~ g(x) and independent threshold U ~ Uniform(0, 1); (2) If U ≤ f(Y) / [c g(Y)], accept X = Y; otherwise, reject Y and repeat. The accepted variates follow density f(x) exactly.

Why does the probability of acceptance in rejection sampling equal exactly 1/c?

Let A denote the event that a candidate proposal is accepted: A = {U ≤ f(Y) / (c g(Y))}. Conditioning on the candidate value Y = y yields P(A | Y = y) = f(y) / (c g(y)). Integrating over the proposal distribution gives P(A) = ∫ P(A | Y = y) g(y) dy = ∫ [f(y) / (c g(y))] g(y) dy = (1/c) ∫ f(y) dy = 1/c, since f(y) is a valid probability density integrating to 1. The number of proposals required to obtain one accepted variate follows a Geometric distribution with parameter p = 1/c, having expected value E[N] = 1/p = c.

How is the bounding constant c optimized, and what happens if c is poorly chosen?

To maximize sampling efficiency (acceptance rate 1/c), the bounding constant c must be minimized subject to the envelope condition: c_opt = sup_{x} [f(x) / g(x)]. If c < c_opt, the envelope fails to majorize f(x), distorting the target distribution and producing biased samples. If c is chosen unnecessarily large (e.g., in high-dimensional spaces), the acceptance probability 1/c drops exponentially toward zero, rendering the algorithm computationally infeasible (the curse of dimensionality).

What is the Ziggurat algorithm, and how does it optimize rejection sampling for standard normals?

Developed by George Marsaglia and Wai Wan Tsang in 2000, the Ziggurat algorithm covers the target probability density (such as the standard Gaussian curve) with a stack of horizontal rectangular layers (resembling a ziggurat). The layers are constructed to have identical areas. For 98% of proposals falling within the completely enclosed core of a rectangle, the variate is accepted immediately without evaluating expensive exponential or transcendental functions, making it the fastest known algorithm for normal and exponential generation.

How does Adaptive Rejection Sampling (ARS) construct envelopes for log-concave densities?

Introduced by Gilks and Wild in 1992, Adaptive Rejection Sampling constructs piecewise linear upper and lower bounding envelopes in the log-density domain ln f(x). Because f(x) is log-concave (d^2 ln f(x) / dx^2 ≤ 0), tangents to the log-density curve lie strictly above the curve, forming an envelope whose exponent is piecewise exponential. Whenever a candidate is rejected, the evaluated point is added to update the envelope, causing the envelope to converge progressively to f(x) and driving acceptance efficiency toward 100%.

What advantages does Markov Chain Monte Carlo (MCMC) have over classical rejection sampling in high dimensions?

Classical rejection sampling requires constructing a global majorizing envelope c g(x). In d dimensions, the volume of the target density relative to any standard proposal envelope typically shrinks as (1/c)^d, causing acceptance rates to collapse to near zero. MCMC algorithms (such as Metropolis-Hastings) bypass the need for a global envelope by generating a correlated random walk that explores the target distribution locally based only on local density ratios f(x')/f(x), making simulation viable in high-dimensional Bayesian models.

Experimental precautions and statistical checks

  • Ensure the bounding condition f(x) ≤ c g(x) holds strictly across the entire support domain to avoid distribution distortion.
  • Verify that uniform variates U_1 (for proposal) and U_2 (for acceptance test) are drawn from independent random streams.
  • Check that the proposal density g(x) has tails at least as heavy as target density f(x) to prevent c from diverging to infinity.
  • Monitor acceptance rates continuously during long simulation runs to detect potential numerical envelope violations.

Theoretical assumptions & limitations

  • Acceptance-rejection sampling becomes computationally inefficient in high-dimensional parameter spaces (curse of dimensionality).
  • The Inverse Transform method is limited by the analytical or numerical tractability of inverting the cumulative distribution function.
↳
Connect theory to empirical data.

The empirical regression of candidate proposals against target quota yields a linear gradient of m = 1.5000, confirming the theoretical envelope factor c = 1.500 with R² = 1.000000.