Multinomial {distributions3} | R Documentation |
Create a Multinomial distribution
Description
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 ()
times.
Usage
Multinomial(size, p)
Arguments
size |
The number of trials. Must be an integer greater than or equal
to one. When |
p |
A vector of success probabilities for each trial. |
Details
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 be a Multinomial
random variable with success probability
p
= . Note that
is vector with
elements that sum to one. Assume
that we repeat the Categorical experiment
size
= times.
Support: Each is in
.
Mean: The mean of is
.
Variance: The variance of is
.
For
, the covariance of
and
is
.
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):
Value
A Multinomial
object.
See Also
Other discrete distributions:
Bernoulli()
,
Binomial()
,
Categorical()
,
Geometric()
,
HurdleNegativeBinomial()
,
HurdlePoisson()
,
HyperGeometric()
,
NegativeBinomial()
,
Poisson()
,
ZINegativeBinomial()
,
ZIPoisson()
,
ZTNegativeBinomial()
,
ZTPoisson()
Examples
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)