Overview
Multinomial sampling generalizes categorical sampling to multiple draws, producing category counts that follow specified probabilities.
Draws counts or categories according to a discrete probability vector.
Compact metadata for implementation and discovery.
Multinomial sampling generalizes categorical sampling to multiple draws, producing category counts that follow specified probabilities.
Quick facts
Runtime and memory behavior at a glance.
Best
O(k)
Average
O(draws * k)
Worst
O(draws * k)
Space
O(k)
P(counts) = n! / product c_i! * product p_i^c_iGives the probability of observing a count vector after n draws.
Plot generated samples against the target distribution or domain.
Multinomial Sampling should be used with the assumptions and tradeoffs of discrete Sampling in mind.
What each reference supports for this entry.
Random variate generation reference for Multinomial Sampling sampling from categorical and multinomial distributions.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Alias sampling is one efficient way to draw repeated multinomial outcomes.