bundles / scipy 1.17.1 / scipy / stats / _multivariate / multivariate_hypergeom_gen / rvs
function
scipy.stats._multivariate:multivariate_hypergeom_gen.rvs
Signature
def rvs ( self , m , n , size = None , random_state = None ) Summary
Draw random samples from a multivariate hypergeometric distribution.
Parameters
m: array_likeThe number of each type of object in the population. That is, is the number of objects of type .
n: array_likeThe number of samples taken from the population.
size: integer or iterable of integers, optionalNumber of samples to draw. Default is
None, in which case a single variate is returned as an array with shapem.shape.seed: {None, int, np.random.RandomState, np.random.Generator}, optionalUsed for drawing random variates. If seed is
None, the~np.random.RandomStatesingleton is used. If seed is an int, a newRandomStateinstance is used, seeded with seed. If seed is already aRandomStateorGeneratorinstance, then that object is used. Default isNone.
Returns
rvs: array_likeRandom variates of shape
sizeorm.shape(ifsize=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