Number of successes (r > 0, integer)
Probability of success in each trial (0 < p ≤ 1)
Probability of success
Probability of failure
Number of successes
Cumulative distribution function (CDF).
Number of failures
P(X ≤ k)
Mean of the distribution.
r * (1 - p) / p
Probability mass function (PMF).
Number of failures before r successes (k ≥ 0)
P(X = k)
Generate a random sample using the method of summing geometric variables.
Variance of the distribution.
r * (1 - p) / p²
Class representing the Negative Binomial distribution. Models the number of failures before
r
successes in Bernoulli trials.