[
https://issues.apache.org/jira/browse/RNG-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540619#comment-17540619
]
Alex Herbert commented on RNG-179:
----------------------------------
Thanks for the suggestion. The provided paper shows it may be faster with a
lower entropy distribution. It certainly uses less bits for each sample. The
memory usage seems to be higher although initialisation cost is lower.
I can have a look at implementing this for the distributions specified using
integer ratios:
{code:java}
UniformRandomProvider rng = ...;
int[] distribution = {1, 1, 2, 3, 1};
DiscreteSampler sampler = FastLoadedDiceRoller.of(rng, distribution);
{code}
> The Fast Loaded Dice Roller: A Near-Optimal Exact Sampler for Discrete
> Probability Distributions
> ------------------------------------------------------------------------------------------------
>
> Key: RNG-179
> URL: https://issues.apache.org/jira/browse/RNG-179
> Project: Commons RNG
> Issue Type: New Feature
> Components: sampling
> Reporter: Vladimir Sitnikov
> Priority: Major
>
> It might make sense to implement Fast Loaded Dice Roller sampler.
> See https://arxiv.org/pdf/2003.03830v2.pdf,
> https://github.com/probcomp/fast-loaded-dice-roller
> The authors claim that Fast Loaded Dice Roller is faster than the Alias
> Method.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)