Description
The DiscreteProbabilityCollectionSampler builds a cumulative probability distribution from an input of items and their associated probabilities. This is sampled using a binary search (O(log n) time).
The library now contains DiscreteSamplers that can sample efficiently (approaching O(1) time) from a cumulative probability distribution:
- AliasMethodDiscreteSampler
- GuideTableDiscreteSampler
Test these samplers to determine which is appropriate to use as the algorithm behind the DiscreteProbabilityCollectionSampler. The test should include:
- Construction time
- Sample time
- A range of distributions (uniform, linear ramp, Poisson, Geometric, BiModal, TriModel, Random scatter)
Attachments
Issue Links
- relates to
-
RNG-179 The Fast Loaded Dice Roller: A Near-Optimal Exact Sampler for Discrete Probability Distributions
-
- Closed
-
- links to