Optimal approximate sampling from discrete probability distributions
Open Access
- 20 December 2019
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 4 (POPL) , 1-31
Abstract
This paper addresses a fundamental problem in random variate generation: given access to a random source that emits a stream of independent fair bits, what is the most accurate and entropy-efficient algorithm for sampling from a discrete probability distribution ( p 1 , …, p n ), where the probabilities of the output distribution ( p̂ 1 , …, p̂ n ) of the sampling algorithm must be specified using at most k bits of precision? We present a theoretical framework for formulating this problem and provide new techniques for finding sampling algorithms that are optimal both statistically (in the sense of sampling accuracy) and information-theoretically (in the sense of entropy consumption). We leverage these results to build a system that, for a broad family of measures of statistical accuracy, delivers a sampling algorithm whose expected entropy usage is minimal among those that induce the same distribution (i.e., is “entropy-optimal”) and whose output distribution ( p̂ 1 , …, p̂ n ) is a closest approximation to the target distribution ( p 1 , …, p n ) among all entropy-optimal sampling algorithms that operate within the specified k -bit precision. This optimal approximate sampler is also a closer approximation than any (possibly entropy-suboptimal) sampler that consumes a bounded amount of entropy with the specified precision, a class which includes floating-point implementations of inversion sampling and related methods found in many software libraries. We evaluate the accuracy, entropy consumption, precision requirements, and wall-clock runtime of our optimal approximate sampling algorithms on a broad set of distributions, demonstrating the ways that they are superior to existing approximate samplers and establishing that they often consume significantly fewer resources than are needed by exact samplers.Keywords
All Related Versions
This publication has 30 references indexed in Scilit:
- A fast random number generator for stochastic simulationsComputer Physics Communications, 2009
- Generation of discrete distributions from biased coinsIEEE Transactions on Information Theory, 1996
- Generating random bits from an arbitrary source: fundamental limitsIEEE Transactions on Information Theory, 1995
- Approximation theory of output statisticsIEEE Transactions on Information Theory, 1993
- A linear algorithm for generating random numbers with a given distributionIEEE Transactions on Software Engineering, 1991
- Accuracy in random number generationMathematics of Computation, 1985
- A note on approximations in random variate generationJournal of Statistical Computation and Simulation, 1982
- An Efficient Method for Generating Discrete Random Variables with General DistributionsACM Transactions on Mathematical Software, 1977
- New fast method for generating discrete random numbers with arbitrary frequency distributionsElectronics Letters, 1974
- On Information and SufficiencyThe Annals of Mathematical Statistics, 1951