Skip to content

Generate k samples from discrete distribution with time cost O(k)

Notifications You must be signed in to change notification settings

bolongz/Systematic-Alias-Sampling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is C++ program to implement the SAS method.

To use the SAS method, just include the sas in your C++ source code. Some tests have been taken in test.cpp file.

References:

  1. Ilari Vallivaara, Katja Poikselkä, Pauli Rikula, and Juha Röning. 2016. Systematic Alias Sampling: An Efficient and Low-Variance Way to Sample from a Discrete Distribution. ACM Trans. Math. Softw. 43, 3, Article 18 (August 2016), 17 pages. DOI: https://doi.org/10.1145/2935745

  2. Kronmal, Richard A., and Arthur V. Peterson. “On the Alias Method for Generating Random Variables from a Discrete Distribution.” The American Statistician, vol. 33, no. 4, 1979, pp. 214–218. www.jstor.org/stable/2683739.

About

Generate k samples from discrete distribution with time cost O(k)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published