cupy.random.negative_binomial#

cupy.random.negative_binomial(n, p, size=None, dtype=<class 'int'>)[source]#

Negative binomial distribution.

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

\[f(x) = \binom{x + n - 1}{n - 1}p^n(1-p)^{x}.\]
Parameters
  • n (int) – Parameter of the negative binomial distribution \(n\).

  • p (float) – Parameter of the negative binomial distribution \(p\).

  • 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 negative binomial distribution.

Return type

cupy.ndarray