NumPy RandomLesson 26Free preview
Multinomial Distribution
This lesson is part of NumPy · All levels
Summary
A multinomial distribution is a binomial generalization for more than two categories. np.random. multinomial(n, pvals, size) returns the success rate of each category of n experiments with the probability of each category. For example, the number of dice thrown is an integer in many rounds.
Key points
- Multinomial(n, pvals, size) with pvals is a list of each category's odds.
- The number of chances in pvals must be equal to 1 (or close to).
- The result of each sample is a tuple/array of the number per category that is n.
- A binomial is a special case of a multinomial with two categories.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.