{ } Raw JSON

bundles / scipy latest / scipy / stats / _discrete_distns / nbinom_gen

class

scipy.stats._discrete_distns:nbinom_gen

source: /scipy/stats/_discrete_distns.py :280

Signature

class   nbinom_gen ( a = 0 b = inf name = None badvalue = None moment_tol = 1e-08 values = None inc = 1 longname = None shapes = None seed = None )

Members

Summary

A negative binomial discrete random variable.

Extended Summary

%(before_notes)s

Notes

Negative binomial distribution describes a sequence of i.i.d. Bernoulli trials, repeated until a predefined, non-random number of successes occurs.

The probability mass function of the number of failures for nbinom is:

for ,

nbinom takes and as shape parameters where is the number of successes, is the probability of a single success, and is the probability of a single failure.

Another common parameterization of the negative binomial distribution is in terms of the mean number of failures to achieve successes. The mean is related to the probability of success as

The number of successes may also be specified in terms of a "dispersion", "heterogeneity", or "aggregation" parameter , which relates the mean to the variance , e.g. . Regardless of the convention used for ,

This distribution uses routines from the Boost Math C++ library for the computation of the pmf, cdf, sf, ppf, isf and stats methods. [1]

%(after_notes)s

See also

binom
hypergeom
nhypergeom

Aliases

  • scipy.stats._discrete_distns.nbinom_gen