draw_multinom | R Documentation |
Warning: this function does no argument checking. Ensure the arguments are as follows.
draw_multinom(n, prob)
n |
an integer giving the number of balls to distribute in bins |
prob |
a vector of probabilities for each bin, which must sum to one |
an integer vector of length equal to the length of prob
This function uses the algorithm presented in: Startek, MichaĆ. "An asymptotically optimal, online algorithm for weighted random sampling with replacement." arXiv preprint arXiv:1611.00532 (2016).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.