{ } Raw JSON

bundles / scipy latest / scipy / stats / _multivariate / multivariate_hypergeom_gen / rvs

function

scipy.stats._multivariate:multivariate_hypergeom_gen.rvs

source: /scipy/stats/_multivariate.py :5998

Signature

def   rvs ( self m n size = None random_state = None )

Summary

Draw random samples from a multivariate hypergeometric distribution.

Parameters

m : array_like

The number of each type of object in the population. That is, is the number of objects of type .

n : array_like

The number of samples taken from the population.

size : integer or iterable of integers, optional

Number of samples to draw. Default is None, in which case a single variate is returned as an array with shape m.shape.

seed : {None, int, np.random.RandomState, np.random.Generator}, optional

Used for drawing random variates. If seed is None, the ~np.random.RandomState singleton is used. If seed is an int, a new RandomState instance is used, seeded with seed. If seed is already a RandomState or Generator instance, then that object is used. Default is None.

Returns

rvs : array_like

Random variates of shape size or m.shape (if size=None).

Notes

m must be an array of positive integers. If the quantile contains values out of the range where is the number of objects of type in the population or if the parameters are inconsistent with one another (e.g. x.sum() != n), methods return the appropriate value (e.g. 0 for pmf). If m or n contain negative values, the result will contain nan there.

Also note that NumPy's multivariate_hypergeometric sampler is not used as it doesn't support broadcasting.

Aliases

  • scipy.stats._multivariate.multivariate_hypergeom_gen.rvs