The OpenD Programming Language

poissonLPMF

Computes the poisson log probability mass function (LPMF).

@safe pure nothrow @nogc
T
poissonLPMF
(
T
)
(
const size_t k
,
const T lambda
)
if (
isFloatingPoint!T
)

Parameters

k size_t

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

lambda T

expected rate of occurence

Examples

import mir.math.common: approxEqual, exp;

for (size_t i; i <= 10; i++) {
    assert(i.poissonLPMF(5.0).exp.approxEqual(poissonPMF(i, 5.0)));
}

See Also

Meta