The OpenD Programming Language

negativeBinomialPMF

Computes the negative binomial probability mass function (PMF).

@safe pure nothrow @nogc
T
negativeBinomialPMF
(
T
)
(
const size_t k
,
const size_t r
,
const T p
)
if (
isFloatingPoint!T
)

Parameters

k size_t

value to evaluate PMF (e.g. number of "heads")

r size_t

number of successes until stopping

p T

true probability

Examples

import mir.test: shouldApprox;

4.negativeBinomialPMF(6, 3.0 / 4).shouldApprox == 0.0875988;

See Also

Meta