Create a new Drv representing the passed in distribution of probabilities.
Create a new Drv representing the passed in distribution of probabilities. These must add up to 1, however we cannot reliably test for this due to numerical stability issues: we're operating on the honor's system.
Create a probability distribution based on a set of weights (ratios).
Generate probability and alias tables in the manner of to Vose [1].
Generate probability and alias tables in the manner of to Vose [1]. This algorithm is simple, efficient, and intuitive. Vose's algorithm is O(n) in the distribution size. The paper below contains correctness and complexity proofs.
[1] Michael D. Vose. 1991. A Linear Algorithm for Generating Random Numbers with a Given Distribution. IEEE Trans. Softw. Eng. 17, 9 (September 1991), 972-975. DOI=10.1109/32.92917 http://dx.doi.org/10.1109/32.92917
Create discrete random variables representing arbitrary distributions.