Optimal approximate sampling from discrete probability distributions. Saad, F. A., Freer, C. E., Rinard, M. C., & Mansinghka, V. K. Proceedings of the ACM on Programming Languages, 4(POPL):36:1–36:31, ACM, January, 2020. Paper Supplement Video Code Experiments Link abstract bibtex 60 downloads 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.
@article{saad2020sampling,
title = {Optimal approximate sampling from discrete probability distributions},
author = {Saad, Feras A. and Freer, Cameron E. and Rinard, Martin C. and Mansinghka, Vikash K.},
journal = {Proceedings of the ACM on Programming Languages},
volume = 4,
number = {POPL},
month = jan,
year = 2020,
pages = {36:1--36:31},
articleno = 36,
numpages = 31,
publisher = {ACM},
keywords = {discrete random variables, random variate generation},
url_paper = {https://dl.acm.org/ft_gateway.cfm?id=3371104},
url_supplement = {https://dl.acm.org/action/downloadSupplement?doi=10.1145%2F3371104&file=popl20main-p126-p-aux.zip&download=true},
url_video = {https://www.youtube.com/watch?v=Eb0CtuK7K3g},
url_code = {https://github.com/probcomp/optimal-approximate-sampling},
url_experiments = {https://doi.org/10.1145/3373106},
url_link = {https://doi.org/10.1145/3371104},
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, \dots, p_n)$, where the probabilities of the output distribution $(\hat{p}_1, \dots, \hat{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 $(\hat{p}_1, \dots, \hat{p}_n)$ is a closest approximation to the target distribution $(p_1, \dots, 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.},
}
Downloads: 60
{"_id":"3kRqTQJpwdRTSFJLP","bibbaseid":"saad-freer-rinard-mansinghka-optimalapproximatesamplingfromdiscreteprobabilitydistributions-2020","authorIDs":["24ZZQYHs34DAa9Kr6","28Pw99RLurcmHxnQi","2Hocqzo62AGpazysG","2Rnuo8am6ZJ3zaiWF","2xQ3QSvHeSkx37vFX","3BTqPkyp87F3LdfbT","3DwpmEKdz76sHpmms","3aLDT4CEdr9WQpBic","3h44YL555EzhtTyov","3sWyAGovNzzFZeFzb","3zMd5SAGagiqnQFLx","464Mzt2HES7jktmMC","4QwQPXfYWxAfrqD3x","4YcH7NwtDKS68uEYh","4rod99bRJ9kDkjxjq","4uKY4xENBpZT6dDoq","585Ntjij9LqzHgJec","5GyX8nSxnzPXAAriL","5JatimquQYofrgtYy","5XYQacne4xXLAyusX","5bcf251ecd6cac10000000a8","5de6d7c1abd988de01000108","5de6dd20abd988de01000182","5de81cfb4e3c5af301000065","5de823cd4e3c5af3010000fa","5de83b1d8cf0fbde01000084","5de83d928cf0fbde010000ab","5de8698c8ff138de01000147","5de88cbb2c5eb2df0100002e","5de8a8213cfb74df01000035","5de8f0e8978afbdf01000156","5de91f095d589edf010000c7","5de96d2e768c31df0100005a","5de96e66768c31df0100007a","5deaa35d03c11ade01000047","5deab8db03c11ade0100026d","5deab9dd03c11ade01000286","5deac944cd660bde0100014b","5ded4f29a49d79de010000de","5ded89c85fefb3de010000ae","5def414066cfe0df01000046","5df06853e4ce32df0100011c","5df172f857cfb4de0100003f","5df264cd63aac8df01000188","5df26ca127cd2fde01000015","5df2872327cd2fde010001d7","5df2a9960f18f1df01000071","5df2c9ac79c00ade01000083","5df358afd617e5de010000b1","5df3ad7cec6029de010000e0","5df3c3db580920de01000073","5df4b300a50a84df010000d5","5df703a9df3bb9f20100016a","5df703ecdf3bb9f201000171","5df8c1cae6b510df01000118","5df92961d04b27df010000b8","5dfa9539669fc3df01000090","5dfb3d1ee04f92df0100005e","5dfbf72d4d4fb9de01000196","5dff6a86cb2e2bde0100005a","5e038ae0d6cccbdf010000c0","5e049d4410c665de010000ab","5e04a0f310c665de010000db","5e05ca85459a30df01000068","5e068dfcd4589cdf01000061","5e0feb62063b5cde0100007e","5e10ecb745c12cde010000b5","5e166c3a505a61df010008b7","5e179346d954d8df01000043","5e192f00eaca22df01000058","5e1a2e059fbdddde0100010d","5e1b379c749a45df01000050","5e1c5707e556c6de01000100","5e1c5c86e556c6de01000176","5e1cdc1dabed9bde010000bf","5e1dde194986afdf0100015b","5e1e26c2407a20de01000019","5e1e523e2e41a7de010000fb","5e1e5c672e41a7de01000166","5e1f240307379ade0100001d","5e1f2d8107379ade010000b6","5e1f7418e8f5ddde0100022b","5e1f7f8008195af301000090","5e20acde5c2065de0100000d","5e20b7445c2065de010000ac","5e20ba3d5c2065de010000db","5e210a69c63e88df01000071","5e219f263ef35cdf010000c7","5e248ed68c3885df0100007a","5e24b9fb1a6264de0100011c","5e251a51b55b9edf01000074","5e25cf83f299d4de010001cc","5e2639f624c8a6de010000cb","5e2666dd581147f201000031","5e270bf4f51e02de01000009","5e270ca3f51e02de0100001f","5e2778b858994fde01000224","5e28a71d88416fde01000173","5e28b1ca6acacbdf01000016","5e28d496a3df5bdf01000064","5e28e19ca3df5bdf010000ff","5e2b545e6366e2df01000002","5e2c8658ce5606de01000102","5e2ca62ecca05fde01000003","5e2cbca6cca05fde01000118","5e2de707133023de0100009b","5e2e2f1ecc9e90e401000118","5e2ea7efb84405df0100007c","5e2ec219c2015cde01000055","5e2ef9e4e374eede0100006c","5e2effa8e374eede01000104","5e2f5fa326e5cadf01000312","5e30a8ccc99510de0100010b","5e3136a55a3ceade010000be","5e3137a05a3ceade010000d1","5e31c760b5384fde01000176","5e31c93cb5384fde01000193","5e31c98ab5384fde0100019b","5e31cd5bb5384fde0100023d","5e31ce27b5384fde01000269","5e31d2cabba4d0de01000061","5e31d5f6bba4d0de01000095","5e329a80e17accde01000069","5e3433c641f782de01000167","5e3495dc53b794de010000b4","5e34be67ed2109df010000b7","5e353ab3ba591ddf0100000f","5e3609e5591ba4de010000b1","5e36a8d77b975dde01000016","5e36dd76b26a0fde01000001","5e36e37db26a0fde0100003c","5e37827bac7fe8de0100014e","5e382c240691b8de010001ee","5e383748ca2b4bde010000d9","5e383b96ca2b4bde0100014f","5e384061ca2b4bde010001b8","5e38414bca2b4bde010001e1","5e386555ccda85de01000635","5e386a131f8af9e001000040","5e3880661f8af9e0010001d9","5e3881a71f8af9e0010001ee","5e388c7d030bcadf010000a3","5e397ce6346d7cde010001fd","5e3991c6d14579de010001db","5e39bfbfd6538cdf0100004b","5e39cc6dd6538cdf0100015e","5e39d34cd6538cdf010001d1","5e39f362aa2adade01000038","5e3ad4901b85fadf01000033","5e3ae1bc1b85fadf01000133","5e3b098555f0f2df010001b9","5e3b2960255dcade01000047","5e3b3442255dcade0100011b","5e3c2ec634cd37de010000e9","5e3c6e9d67788ede01000110","5e3c9dcdf99721de01000076","5e3c9fbbf99721de010000a0","5e3cdde75cd237de010000a4","5e3d2557c405ecde01000034","5e3d7fc696e576de010000c4","5e3ecf0086a596de01000058","5e3f47c777baf5df0100009f","5e3f9974cecf86de0100017a","5e40136f17f17dde0100019b","5e4041f7668183de0100008a","5e41b6a30b4861de0100017a","5e41ef93a9454ade010001b0","5e4202a4ebe241de010000d7","5e420517ebe241de010000ff","5e428bc75ea111df010000bd","5e42c7eee7fe39df010000e7","5e436014a37866de01000174","5e43f473547b4cdf0100004c","5e4418e1fdc393de010000de","5e44454edf3c2af30100000a","5e445a86df3c2af301000191","5e4487f5ec14b3de01000094","5e44ce167759a7df0100013e","5e44ec83ab9cedde0100011d","5e453154605639de01000088","5e46bd088573d1de010000e5","5e49612b16841dde01000076","5e498800407e6cde01000103","5e49c95eb63120f201000048","5e4abc2c15f6c7df010001ef","5e4b94db2d0ef5de010000aa","5e4bad3b733a18de010000c2","5e4de9e752c311f201000154","5e4e0047cc196bde0100014c","5e4ea27764b624de010000a8","5e4ea58d64b624de010000e0","5e4f42208a3535f301000013","5e50afb4e3d144df01000002","5e50b11be3d144df01000013","5e51f6d68240c0df01000079","5e53fa64d26e87df010001f0","5e54502988d190df01000016","5e553b5dca58a8df010000e3","5e55504be89e5fde01000037","5e557e89e11ab9df0100010f","5e55aa627d0846de01000096","5e55f822819fabdf01000028","5e56c16a96127bde010000ac","5e57501b18f14bdf01000058","5e580681a38020de010001c7","5e59268fe60e02de01000035","5e5c1fcb15d8f5de01000029","5e5c3c7e68f281de01000030","5e5cada2a9598ddf01000029","5e5d3b9b73eb2edf0100008b","5e5d5e1ead47bcde010000d8","5e5d676cad47bcde01000156","5e5fb8c519c3fade01000205","5e60058913e3aede010000e5","5e6005b013e3aede010000eb","5e6005d313e3aede010000f4","5e60064213e3aede010000fd","5e60066813e3aede01000104","5e60078013e3aede01000110","5e6007bb13e3aede0100011f","5e6007cf13e3aede01000123","5e60080c13e3aede01000134","5e60088613e3aede01000156","5e6008bb13e3aede01000165","5e600a2713e3aede01000197","5e6012ecc064fcde01000046","5e601354c064fcde01000071","5e601946c064fcde010000ed","5e6019aec064fcde01000101","5e601a2ec064fcde0100010d","5e601a41c064fcde01000111","5e601a54c064fcde01000117","5e601a57c064fcde01000119","5e601a69c064fcde01000120","5e601a86c064fcde01000128","5e601afec064fcde01000156","5e601b52c064fcde01000173","5e601caec064fcde010001d8","5e601d32c064fcde010001e4","5e601d58c064fcde010001eb","5e601db8c064fcde010001fe","5e601e01c064fcde01000209","5e601e1fc064fcde0100020c","5e6035b2182590df01000070","5e6108ef31c7d3de010001ef","5e613e4697c182e901000170","5e6140b497c182e9010001bd","5e61416897c182e9010001d5","5e61418397c182e9010001db","5e61421997c182e9010001fa","5e61423697c182e901000202","5e6142b297c182e901000217","5e6143b997c182e90100024b","5e6144cb97c182e90100027c","5e614762956b37df01000025","5e6147cb956b37df01000034","5e6147cf956b37df01000036","5e614823956b37df01000047","5e614848956b37df0100004f","5e6148f6956b37df0100006c","5e6149b8956b37df01000081","5e6171e6417d19de0100013a","5e6172fd417d19de01000162","5e617359417d19de01000169","5e61743a417d19de01000184","5e617465417d19de01000189","5e617609417d19de010001aa","5e617696417d19de010001b3","5e6177a5417d19de010001ca","5e6177c2417d19de010001ce","5e617852417d19de010001f0","5e6193c81d4ccede0100010b","5e61a5fa2ef239de01000069","5e61c964abaeaede0100010d","5e6264ec11ac5fde01000066","5e62697811ac5fde01000100","5e62a99408ebcade01000152","5e62ab4d08ebcade0100016e","5e62eb133ba99bdf01000131","5e62eb9d377bb9de01000002","5e633e70716092de010000c8","5e63c4ac74499adf01000108","5e63d62f78da4fdf0100006a","5e6527d9ee6356df01000070","5e659b015dd5c8de01000086","5e676de810be53de0100000a","5e67759110be53de01000072","5e67b2c184cf9ede0100041c","5e67e8d00e29d3de01000164","5e67ef260e29d3de01000223","5e6920fa662319de01000226","5e6971b1ae9c71de0100033c","5e69a3dc23ebccde01000062","5e6b9b4138517edf0100000b","5kT7ojhuB22wGn6pt","5tqh95krD4dKFNZAQ","5x3AEdxLnChwvZa8g","69vAtG6YtnrsSoazH","6EWojj4LmiAwaL6B9","6Ffmir77DS8x3E6sx","6JEETkGR6ZRiAfczM","6TLgrWa44XWGyNXgP","6e2XFy229hLbFR99A","6g5xvCGSh2vtto77h","6huhEvSXfaqHXmkc3","75bFNvjwbxXRG4yCg","7DBAebkzkzghuoYzR","7LxvPnLQ5LmtN2oih","7PnbdWfd9vxcGEmqs","7RXMsKBr98X9uDG4u","7ciJ76kYqGFFFHg2A","7nrMwnG4s5qdFJFZo","7qwQRtBSKxFLoshsT","7sD9QYn38k6CWpDP4","85yCL2SYx2tjZo89P","8eeAa2j6MpLZi53zn","8gia9Wcidjqp4tov5","94Hpgyrdi9jy4XNfi","9JYRiKpufhJJzKFwW","9vADaRieFWKoQPYGA","9x6sTTNqAw2FaeeWG","9yWXZ5ebx92nLDhL2","A7MG4bLJGjd3nScQN","ANKFWzBqWy9E3pEaZ","BSch39FbG778QEiy5","BaD4cmvBYjC63mtCM","BkX37EvGx8eMaKWi2","BtBojnWebnx7wJENc","Bv3Zb4Heu6oao7LnR","C5WLgjYCWGp8LBkmp","CCHfnDadCwL3KoB9E","CLPkk3fjJiHBM3Y8f","ChiohN3JKHSyXQA3m","CiC5mkb4wNBrYR4We","CqY7Kc6gRRDohbtu9","D8TuWoWXbPtuvvx2B","DDevC6ZgEpNgZWH3X","DSTBpPjpYJ7CrMgaG","DY9xcsoTYxu4PcDug","DzywbfM9RtjEziNni","E3FPR2oSan5tuHkyw","E7NDYosNnpGkNTzcR","EEpw2vd5BnZwztHEi","EJHss79aCiBRDZzPu","EKbcyTPbo56hpER8z","ELh3gPsJzYdwvJByj","EcbrbYRcyh2MnmkHB","Edfq2hw3azcDSTkEs","EtCE2kkfYCoWt2Ejw","EvNdDTjjqKFS2AnSi","F26qR6WH5QodtsYb4","G2XSrL9u7Zo4p75tM","G4TxepEm9bNPjAeMw","GQFnFjkwarniwEv3W","Gres6ZKfGnprpeamY","HF68i5BjL9KiE5P7o","HJLuNjpriEJ9QwHXT","HMLjh7735Nf6KaJwA","HcwYCxEWMuy337yxY","HfBtxat7wEXtvmNx4","HgNFZX9da6d5znCcG","J7d7XjpSZNthLLmzm","JK4SPS2cSvf3cPQDP","Js3p25Ebif4kCDGX9","KBQ4a4vXbMzrtd9Ri","KCHLdJic3Xti28ycM","KXgQR7wLS6mAhktez","KbdpDdmpcBK8frGCg","Kibc5hjLCbcH33GZR","Kkh3yAifcZRRazsTE","KtCvweD8r92ANqQ9s","Kv89ueyzCCxX323kg","LSr8rdNmg6JzNc6s3","Lny2nNi3DiKEBXHpH","Lr9vLkup6tgRqb2H6","M9H5ZjDn8qsDKy2HS","MpjduyZMdMMeTCQar","MqntDHkL73WMSYYEf","MtTEKC4XxAQntH2m9","MzrNu3MqSeatEHDuB","N2AiqindFhfTWwzG9","N9tCGBsMcBkr7h3Jf","NFGnmR7f5ZLhR3Y83","NjsqzFAPLtjHWDutm","NuNFTPoNEJsvXiAdw","P2boEvDD9nEtLDcsT","P66zMu2uevumeMyNQ","PEv4bHqvu98SoC7Nr","PGr3aYEWEcRsJTTMM","PZHqjKS2BtKjzq28j","Pad7dGf7zRDQKnfPu","PbKBaE9nWH4yrgQsn","PfxG4GGaqck8CYBgW","PgdLqFJEDcZXck7XY","PyejnXwfbytABY8Ss","QPkFZFs4JtdTMMYeY","QY9z9nWeE7HsheEvM","QcA2w8WB8pskaj36d","QcgXmZjQQehLf48uz","QyCdaaevKJn7zAp7c","R2tXCYgFme4gFKCNC","R9CzgnpThCKSYQYQJ","RBTe6hubxveyMK5HH","RN9Q569t45QtXMRus","RPDNs66wjvQvGCnmW","RX4f9LrmJvdsJgGNq","RutBMyXGKZTCxFmnu","SCDCkFXictWDuwRnP","SDQcntjjZvnPFcWuS","SZjZ9JusAKK99898w","ScZRPZu5ALEREpZNG","SvAeHjtw8uYu3ihPg","TGjnzins6tGHL8EPq","TRnXA3ibpxC4vKmBA","TeRWMwdR8PeyKucsZ","Tfnid3jXw4X5eEAwb","TkMSfrtqiEYcarybr","TpN47khzw8cbrcnkG","W6sSkuAH64Ea4MbEx","W76dvrF39QbxPziTy","W7GKJMGm3FPMm8wN3","W8ge27yKHbWdSnoWv","W93qCNzi5rc6NmKjR","WCiQS7jgbNPDayDoD","WEbj6a2uMBxmTmCZd","WK33EBjTc5HFEx9LY","WdiiwdJgcavsy9dsH","Wza44JooxKS6dBCSY","XE66B9odchJ462xqj","XJAj2ncSnpwZq3Zuv","XQj7AQR5JurFtAY2c","Xmnqb2bDD5TM3DSqK","YLFYg6mMNR3TckeMp","YhFgPXemga3EjrY4C","YkRZrYsisZjGFqn4i","YsG9JDiG3qRSkezZB","YyaFKTK3H8XN77jTo","ZN4Coq5sLaTaqSGkH","ZqkHZRiLR5QK4FFqt","ZrAgNouGZisEYvQ6R","ZuWy2sc6J7Kg5rTaw","a4vfY6tk23HvxuXih","a5mDhx9G7o5DfzwK7","aBiAKt4v4Z8ZNBxHy","aBumSK6KzzzLcQCcD","aQb87jtkZzTpTXmRq","aWmEXD5Bd2HATh5f9","aa43RppmjWcPSNEWn","arer9KQmLSZJyKEjZ","asDCqgPCgWCgd7T5m","azzu48Y9BFosGy6pT","b3kXMriN8W2fvhzGP","b4YuxKEe28fkyofPr","bMpKb8Wx4yXRymKut","bgWkatnia6jr5xayi","bnEjdLAA8CEAzfpS8","borKKcT3xxBpudQ64","bsgRA4rZFfBc8QYoc","cCeCRM6h4ucLQPJ4d","cFdSiDByk4WjY8CAq","cWt6SmxTGrKfAbNHE","cbcqvWgdKjbNqs6mB","ccbF82t7WawnKZ4Rn","cdFMvAfHGmZgC2mf5","co6uTMnYgX9vm8yKt","ctW3gcjN4LJfcbvWL","d4MzZqNqd9RaxYvKg","d8wXTv3AWGbjzpBHg","dH287JHPXSQxmbkaY","dXWXguojmFwXfC343","dcS3nv4fRYtjWdi2q","dmuH2prrwszZRG4Gy","dtxxgovfEi68EZcf8","e4dcY3NNfY2s62sc4","eNrcvXWLvGDMNMTZk","eRagYdajXLmC7qAde","erKe6PYERQP4JjJNS","evFHRXtQiNy2Rbex6","exKqG5EDehFsMCfbj","fGznKFztBFTWKbXcC","fT5agwbbQsrQvHwjr","fbEH2noEwnSJ97K6c","fhgiAXrjjqqpY7MEC","fwa4FWk6o8ifpehjT","fxAe3pLLGAQzMiXtf","g6GQMLLPCYtSEPHJr","gWuDChFbHMsawLBYs","h7nTPA8M5zbg5J7xG","hFXd3NHqjqjt6EYoc","hPyxgq8atsySd5xn2","hSMkzeYwKbFwkzPNf","hbeDvNmTzh9xWZKfE","hd3fRad58ComrShen","hfdKshgYhSgxvHWPG","hnRkpQqfbxyJ3tkn9","hskMGaWwn79efdrq5","iQrP3yuSpq3u5DeGB","iR3L6GjNhtwHoEoFy","iRYtDaK9r3m8jN2Sn","iRiXZZjhB3zha5oX9","iZMPdSMJGv3pWzNuA","iiCzWFNEcEPqwcKvw","iqMpMab3yd9vLzPYB","isSuLydDnaYwiJLKz","j3kRLg9zrogakxiSA","j5XZBLr6PrXYev348","jAL37CjxprJspwLaH","jNvX6sRhoA2H8KcBL","jSeZSdTc7fKqYKPus","jsDXue2QRhPNtXGQ4","kRND6owHip8yssCor","knf5uyxK2ow3SpqCu","kqHwE9tgRXMXu4kEQ","kyq6KHQpzZAdmThEk","mQFywaq3wPjebF2eL","mXh2EpqubDNEMwEjG","mrnsuReH9ustitmYb","n7WdrYhwgBQCu5kr8","nT3poDttXANjYSX6e","nqnh7MctWtHu9Eeri","o5tJCNRb3b7NvZM5q","oLh7xWSFokQyudb2P","ohTwWijM8a9gyzeRF","ourp9XrgdyXj8WFuK","ovSyoqQ7aH52YioMn","pQxuwh4qoozdvFcAc","pd36XDsh7HiCEHrnM","pgXZ828cLEnY2sEGB","piwrxxTYoZJD9vE4v","pjdBNzfX6Fg3iNg3R","pxrWFLGpEpQ42fuBE","q2LtMHAiQoMT8Xchg","qHumEvKrAo59WDsyy","qQ3AasiFibou32YB3","qQGmWXiPhpFtukHky","qWaJKLfpRcauovktX","qZzTbPCMTYnccLMQF","qcv8BfuqP46w5TCgm","qid5XCfkD2WwgLS8R","qyy8E73fj4a6arNav","r7PQ9yjAary28C7nZ","rCk6qGYaiRAdFyk9D","rM5SKh2zyNfWuFtQq","rPbeYkxxnMztRpYJN","rRHCJ6u8mg2RBjEse","rTokX5ZPqXH7AW8Q3","rjMjv9Zs6uN62LBCw","rosk3uCrKbm4zsN9c","rxtH2xFnYvncfWt2t","sPXiTChLNMv3hpXgb","sW5GEKDWvnTewQkbT","sXS57Fc7fgruknxpf","snzsZS4ZoQsssH7jo","t59nTA2vifvAL62fu","tAiJyC4sSeJovKo6g","tEzfQHo2dSBAcxkST","tGstYCAK9uNSeBdMr","tPh5GGfDKphEBoZQh","tQf7bZbHEJ7X2fezF","tf3aDwmjr4hxPxPhj","tgmv2kuNNpCmKkpdZ","uEp67jLjsQBiaC534","uZtecZgDRcNbzjRrS","uhmJ5WhLYgMYerTHi","uiHckiLwyEGaZnMjy","ukjxjyKEfh7uZAsio","uyux8pktYF6ssDoZf","uzkRoqSWcQ6n9Yeyz","v7a3d8AxWiyo9n8Fn","vD49jJLRfcCysRAwG","vGwk5eaop9yEtCJa8","vZw5cZxtwJMvfc58H","vj7jDESLnfMknrEuB","vsMXhpr8ETj9TD5z9","wBP9jvakyv829nNA4","wNDfgWHjeKnqBS9nv","ws6jv4CTkMahvFLhu","xNSyGLEfPK8b9jsnn","xRuBz2yYCKFkHHLXt","xkufTn8vsJ3BtChuK","xmw7Z7X9BxL2T4TXF","yQFLKvbmphB4J32Ju","yY2QrRhTF3HZGJMSj","yY6GA8DJonrxgDYB7","yePcFQx6YsddjgtnJ","yjrJ3sgEPED7nwj9d","yjvi3LGSByST2m4p6","ynu4jgHH2ccNtszqw","zRWju2ET6AQ8fCBJD","zSQERHPnB6FgcG7m9","zWBeaXAxKdgwnXjqh","zX69BSzns4M2sgdcS","zsfGvcy74bAeDKAiM","zwzowH3TqD2cTSYis"],"author_short":["Saad, F. A.","Freer, C. E.","Rinard, M. C.","Mansinghka, V. K."],"bibdata":{"bibtype":"article","type":"article","title":"Optimal approximate sampling from discrete probability distributions","author":[{"propositions":[],"lastnames":["Saad"],"firstnames":["Feras","A."],"suffixes":[]},{"propositions":[],"lastnames":["Freer"],"firstnames":["Cameron","E."],"suffixes":[]},{"propositions":[],"lastnames":["Rinard"],"firstnames":["Martin","C."],"suffixes":[]},{"propositions":[],"lastnames":["Mansinghka"],"firstnames":["Vikash","K."],"suffixes":[]}],"journal":"Proceedings of the ACM on Programming Languages","volume":"4","number":"POPL","month":"January","year":"2020","pages":"36:1–36:31","articleno":"36","numpages":"31","publisher":"ACM","keywords":"discrete random variables, random variate generation","url_paper":"https://dl.acm.org/ft_gateway.cfm?id=3371104","url_supplement":"https://dl.acm.org/action/downloadSupplement?doi=10.1145%2F3371104&file=popl20main-p126-p-aux.zip&download=true","url_video":"https://www.youtube.com/watch?v=Eb0CtuK7K3g","url_code":"https://github.com/probcomp/optimal-approximate-sampling","url_experiments":"https://doi.org/10.1145/3373106","url_link":"https://doi.org/10.1145/3371104","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.","bibtex":"@article{saad2020sampling,\ntitle = {Optimal approximate sampling from discrete probability distributions},\nauthor = {Saad, Feras A. and Freer, Cameron E. and Rinard, Martin C. and Mansinghka, Vikash K.},\njournal = {Proceedings of the ACM on Programming Languages},\nvolume = 4,\nnumber = {POPL},\nmonth = jan,\nyear = 2020,\npages = {36:1--36:31},\narticleno = 36,\nnumpages = 31,\npublisher = {ACM},\nkeywords = {discrete random variables, random variate generation},\nurl_paper = {https://dl.acm.org/ft_gateway.cfm?id=3371104},\nurl_supplement = {https://dl.acm.org/action/downloadSupplement?doi=10.1145%2F3371104&file=popl20main-p126-p-aux.zip&download=true},\nurl_video = {https://www.youtube.com/watch?v=Eb0CtuK7K3g},\nurl_code = {https://github.com/probcomp/optimal-approximate-sampling},\nurl_experiments = {https://doi.org/10.1145/3373106},\nurl_link = {https://doi.org/10.1145/3371104},\nabstract = {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, \\dots, p_n)$, where the probabilities of the output distribution $(\\hat{p}_1, \\dots, \\hat{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 $(\\hat{p}_1, \\dots, \\hat{p}_n)$ is a closest approximation to the target distribution $(p_1, \\dots, 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.},\n}\n\n","author_short":["Saad, F. A.","Freer, C. E.","Rinard, M. C.","Mansinghka, V. K."],"key":"saad2020sampling","id":"saad2020sampling","bibbaseid":"saad-freer-rinard-mansinghka-optimalapproximatesamplingfromdiscreteprobabilitydistributions-2020","role":"author","urls":{" paper":"https://dl.acm.org/ft_gateway.cfm?id=3371104"," supplement":"https://dl.acm.org/action/downloadSupplement?doi=10.1145%2F3371104&file=popl20main-p126-p-aux.zip&download=true"," video":"https://www.youtube.com/watch?v=Eb0CtuK7K3g"," code":"https://github.com/probcomp/optimal-approximate-sampling"," experiments":"https://doi.org/10.1145/3373106"," link":"https://doi.org/10.1145/3371104"},"keyword":["discrete random variables","random variate generation"],"metadata":{"authorlinks":{"mansinghka, v":"http://probcomp.csail.mit.edu/","saad, f":"http://fsaad.mit.edu/"}},"downloads":60,"html":""},"bibtype":"article","biburl":"probcomp.csail.mit.edu/papers.bib","creationDate":"2019-11-13T17:42:34.673Z","downloads":60,"keywords":["discrete random variables","random variate generation"],"search_terms":["optimal","approximate","sampling","discrete","probability","distributions","saad","freer","rinard","mansinghka"],"title":"Optimal approximate sampling from discrete probability distributions","year":2020,"dataSources":["KjwPBikSY3GLxsjaT","PGvySWpKSvwM9TdfF","PcAmxdFwRBJmeNAnx"]}