Adaptive rejection sampling (source code)

= Adaptive rejection sampling

Adaptive rejection sampling builds a piecewise linear upper envelope for a differentiable <log-concave probability density>, samples from its piecewise exponential form, and accepts with the target-to-envelope ratio. Adding evaluated points improves the envelope without changing the target distribution. Initial tangent slopes must yield integrable tails. The accepted draws are exact samples, unlike a finite run of <Markov chain Monte Carlo>.