Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

MultiHypergeometric

Multivariate hypergeometric distribution


Description

Probability mass function and random generation for the multivariate hypergeometric distribution.

Usage

dmvhyper(x, n, k, log = FALSE)

rmvhyper(nn, n, k)

Arguments

x

m-column matrix of quantiles.

n

m-length vector or m-column matrix of numbers of balls in m colors.

k

the number of balls drawn from the urn.

log

logical; if TRUE, probabilities p are given as log(p).

nn

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Probability mass function

f(x) = prod(choose(n, x)) / choose(N, k)

The multivariate hypergeometric distribution is generalization of hypergeometric distribution. It is used for sampling without replacement k out of N marbles in m colors, where each of the colors appears n[i] times. Where k=sum(x), N=sum(n) and k<=N.

References

Gentle, J.E. (2006). Random number generation and Monte Carlo methods. Springer.

See Also

Examples

# Generating 10 random draws from multivariate hypergeometric
# distribution parametrized using a vector

rmvhyper(10, c(10, 12, 5, 8, 11), 33)

extraDistr

Additional Univariate and Multivariate Distributions

v1.9.1
GPL-2
Authors
Tymoteusz Wolodzko
Initial release
2020-08-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.