rmultihyper: The Multivariate Hypergeometric Distribution

View source: R/multihyper.R

rmultihyperR Documentation

The Multivariate Hypergeometric Distribution

Description

Generate random variables for the multivariate hypergeometric distribution

Usage

rmultihyper(n, k, m)

Arguments

n

The number of observations.

k

The total number of balls drawn from the urn.

m

The integer vector containing the number of balls of each color in the urn. Length of vector is the number of colors.

Details

This function generates random variables for the multivariate hypergeometric distribution by iteratively calling hypergeometric random variable generator rhyper.

Value

This function will return a matrix of length(m) rows and n columns, and each column contains the number of balls of each color drawn from the urn.

See Also

rhyper


Corbi documentation built on May 3, 2022, 3:01 a.m.