Sampling MCMC
Adaptive Rejection Sampling
For log-concave densities, build a piecewise linear upper hull of log f(x) that tightens automatically with each evaluation. Sample from the envelope and accept/reject.
Prerequisites
Why This Matters
Standard rejection sampling requires you to find a proposal distribution and a constant such that everywhere. For complex target densities, finding a tight envelope is difficult. A loose envelope means most samples are rejected. Adaptive rejection sampling (ARS), introduced by Gilks and Wild (1992), solves this for log-concave densities by automatically constructing and tightening an envelope as samples are drawn. The envelope only improves over time; no hand-tuning is needed. ARS is widely used as a subroutine inside Gibbs samplers for sampling from univariate full conditionals.
Mental Model
If is concave (a dome shape), then tangent lines to lie above the curve. The minimum of several tangent lines forms a piecewise linear upper bound on . Exponentiating gives an upper envelope for itself, which is a piecewise exponential distribution (easy to sample from). Each time you evaluate at a new point (whether the sample is accepted or rejected), you can add a new tangent line, tightening the envelope. The envelope starts loose and automatically becomes tighter, increasing the acceptance rate over time.
Formal Setup
Let be the unnormalized target density. Assume is concave.
Log-Concave Density
A density is log-concave if is a concave function: for all and . Equivalently, the sublevel sets are convex for all .
Examples: Gaussian, exponential, logistic, gamma (with shape ), beta (with both parameters ), uniform on a convex set. Non-examples: Student-t, Cauchy, mixture of Gaussians (in general).
Upper Hull
Given evaluation points where and have been computed, the upper hull is:
This is the minimum of tangent lines to . Since is concave, each tangent line lies above , so for all .
Lower Hull
The lower hull is the piecewise linear interpolant through the evaluation points:
By concavity, for all in the convex hull of the evaluation points.
The ARS Algorithm
- Initialize with evaluation points. Compute and at each point.
- Construct the upper hull and lower hull .
- Sample where . This is a piecewise exponential distribution: within each segment of , the density is exponential, so sampling reduces to choosing a segment (proportional to its area) and sampling from a truncated exponential.
- Squeezing test: draw . If , accept without evaluating . This saves a (potentially expensive) function evaluation.
- Rejection test: if the squeeze test fails, evaluate . If , accept .
- Update: regardless of acceptance, add to the set of evaluation points and update and .
- Return to step 3.
Core Theory
Validity of the ARS Envelope
Statement
For any set of evaluation points in the support of , the upper hull satisfies for all in the support. Therefore everywhere, and rejection sampling using as the proposal is valid (produces exact samples from ). Furthermore, for all : adding evaluation points can only tighten the envelope.
Intuition
A concave function lies below all of its tangent lines. The minimum of tangent lines is the tightest piecewise linear upper bound available from the given evaluation points. Adding a new tangent line can only lower the minimum (or leave it unchanged), so the envelope never gets worse.
Proof Sketch
For any and any : by the first-order condition for concavity ( for all when is concave). Taking the minimum over preserves the inequality: . For monotonicity: .
Why It Matters
This guarantees that ARS produces exact samples from the target (not approximate). The envelope is always valid regardless of where the evaluation points are placed. The automatic tightening means the acceptance rate improves over the course of sampling without any intervention.
Failure Mode
The theorem requires log-concavity. If is not concave, a tangent line may lie below at some points, and the envelope there. Rejection sampling with an invalid envelope produces biased samples. There is no diagnostic that catches this during sampling; the user must verify log-concavity before applying ARS.
Acceptance Rate Improvement
As grows, pointwise (assuming evaluation points become dense). The acceptance probability at step is:
Since is non-increasing in , is non-decreasing. In practice, ARS often reaches acceptance rates above 90% after 10-20 evaluation points for smooth log-concave densities.
The squeezing test adds further efficiency: when is close to , the squeeze test passes without evaluating , saving computation. The fraction of samples accepted by squeezing also increases as grows.
Limitations
Log-concavity is required. Many important distributions are not log-concave: Student-t (heavy tails), mixtures of Gaussians, posterior distributions with multimodal structure. For these, ARS cannot be applied directly.
Univariate only (in the basic form). The piecewise linear envelope construction works naturally in one dimension. Extensions to multiple dimensions exist (e.g., adaptive rejection Metropolis sampling, ARMS) but lose the guarantee of exact sampling, instead using the envelope as a Metropolis-Hastings proposal.
Derivative required. The basic ARS algorithm needs at evaluation points. Derivative-free variants exist (using secant lines instead of tangent lines) but have slightly worse envelopes.
Common Confusions
ARS is not MCMC
ARS produces independent, exact samples from the target distribution. It is not a Markov chain; there is no burn-in period and no autocorrelation between samples. It is a rejection sampler with an automatically improving proposal. The samples are i.i.d. from the target once accepted.
Tightening the envelope does not invalidate previous samples
When a new tangent line is added, the envelope changes for future proposals, but all previously accepted samples remain valid. Each accepted sample passed a valid rejection test at the time it was drawn, and the envelope was a valid upper bound at that time. The evolving envelope does not retroactively affect past samples.
Key Takeaways
- ARS builds a piecewise linear upper hull of using tangent lines at evaluated points
- The envelope is always valid (above ) by concavity, guaranteeing exact sampling
- Each new evaluation tightens the envelope; acceptance rates improve monotonically
- The squeezing test avoids expensive function evaluations when the lower hull is close to the upper hull
- Log-concavity is a hard requirement; the method silently produces biased samples without it
- ARS is widely used inside Gibbs samplers for univariate full conditionals
Exercises
Problem
Consider (the log of a standard Gaussian). You have two evaluation points: with , , and with , . Write the upper hull and compute . How does this compare to ?
Problem
Prove that the gamma distribution with shape parameter is not log-concave, and therefore ARS cannot be applied directly. Then describe how to handle this case by a change of variables.
References
Canonical:
- Gilks and Wild, Adaptive Rejection Sampling for Gibbs Sampling, Applied Statistics (1992)
- Gilks, Derivative-free Adaptive Rejection Sampling for Gibbs Sampling, Bayesian Statistics 4 (1992)
Current:
-
Robert and Casella, Monte Carlo Statistical Methods (2004), Section 2.3.4
-
Martino and Miguez, Generalized Adaptive Rejection Sampling Schemes, Signal Processing (2011)
-
Gelman et al., Bayesian Data Analysis (2013), Chapters 10-12
-
Brooks et al., Handbook of MCMC (2011), Chapters 1-5
Next Topics
- Gibbs sampling (where ARS is often used for full conditionals)
- Adaptive rejection Metropolis sampling for non-log-concave targets
Last reviewed: April 2026
Prerequisites
Foundations this topic depends on.
- Rejection SamplingLayer 1