Skip to contents

Multinomial distribution

Usage

MultinomialDist(x = NULL, size = NULL, probs = c(0.5, 0.5), n = 0, seed = 0)

Arguments

x

Counts.

size

Number of trials.

probs

Category probabilities (normalised).

n

Number of random count vectors.

seed

Philox seed.

Value

list(pmf, logpmf, mean, cov, random).

References

Johnson, Kotz & Balakrishnan (1997). Discrete Multivariate Distributions, ch. 35.

Examples

MultinomialDist(c(1, 2, 1), probs = c(0.2, 0.5, 0.3))$pmf
#> [1] 0.18