
Last chance! 50% off unlimited learning
Sale ends in
The multinomial distribution is a generalization of the binomial
distribution to multiple categories. It is perhaps easiest to think
that we first extend a Bernoulli()
distribution to include more
than two categories, resulting in a Categorical()
distribution.
We then extend repeat the Categorical experiment several (
Multinomial(size, p)
A Multinomial
object.
The number of trials. Must be an integer greater than or equal
to one. When size = 1L
, the Multinomial distribution reduces to the
categorical distribution (also called the discrete uniform).
Often called n
in textbooks.
A vector of success probabilities for each trial. p
can
take on any positive value, and the vector is normalized internally.
We recommend reading this documentation on https://alexpghayes.github.io/distributions3/, where the math will render with additional detail and much greater clarity.
In the following, let p
= size
=
Support: Each
Mean: The mean of
Variance: The variance of
Probability mass function (p.m.f):
Cumulative distribution function (c.d.f):
Omitted for multivariate random variables for the time being.
Moment generating function (m.g.f):
set.seed(27)
X <- Multinomial(size = 5, p = c(0.3, 0.4, 0.2, 0.1))
X
random(X, 10)
# pdf(X, 2)
# log_pdf(X, 2)
Run the code above in your browser using DataLab