MultiHypergeometric | R Documentation |
Probability mass function and random generation for the multivariate hypergeometric distribution.
dmvhyper(x, n, k, log = FALSE)
rmvhyper(nn, n, k)
x |
|
n |
|
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 |
Probability mass function
f(x) = \frac{\prod_{i=1}^m {n_i \choose x_i}}{{N \choose 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_{i=1}^m x_i
,
N=\sum_{i=1}^m n_i
and k \le N
.
Gentle, J.E. (2006). Random number generation and Monte Carlo methods. Springer.
Hypergeometric
# Generating 10 random draws from multivariate hypergeometric
# distribution parametrized using a vector
rmvhyper(10, c(10, 12, 5, 8, 11), 33)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.