cupy.random.hypergeometric#

cupy.random.hypergeometric(ngood, nbad, nsample, size=None, dtype=<class 'int'>)[source]#

hypergeometric distribution.

Returns an array of samples drawn from the hypergeometric distribution. Its probability mass function is defined as

\[f(x) = \frac{\binom{m}{n}\binom{N-m}{n-x}}{\binom{N}{n}}.\]
Parameters
  • ngood (int or array_like of ints) – Parameter of the hypergeometric distribution \(n\).

  • nbad (int or array_like of ints) – Parameter of the hypergeometric distribution \(m\).

  • nsample (int or array_like of ints) – Parameter of the hypergeometric distribution \(N\).

  • size (int or tuple of ints) – The shape of the array. If None, a zero-dimensional array is generated.

  • dtype – Data type specifier. Only numpy.int32 and numpy.int64 types are allowed.

Returns

Samples drawn from the hypergeometric distribution.

Return type

cupy.ndarray