Skip to content

negativeBinomialDistribution

negativeBinomialDistribution(successes, probability): Distribution

Defined in: negative-binomial-distribution.ts:23

The negative binomial distribution — the number of failures before the successes-th success.

Counting failures rather than trials, so that negativeBinomialDistribution(1, p) is exactly geometricDistribution(p). successes need not be an integer; the Pólya form with a real stopping parameter is the same formula.

number

Number of successes to wait for; must be positive.

number

Success probability of one attempt, in (0, 1].

Distribution

The distribution.

When successes is not positive, or probability is outside (0, 1].