The OpenD Programming Language

fp_poissonPMF

Computes the poisson probability mass function (PMF) directly with extended floating point types (e.g. Fp!128), which provides additional accuracy for large values of lambda or k.

@safe pure nothrow @nogc
T
fp_poissonPMF
(
T
)
(
const size_t k
,
const T lambda
)
if (
is(T == Fp!size,
size_t size
)
)

Parameters

k size_t

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

lambda T

expected rate of occurence

Examples

import mir.bignum.fp: Fp;
import mir.conv: to;
import mir.math.common: approxEqual, exp;

for (size_t i; i <= 10; i++) {
    assert(i.fp_poissonPMF(Fp!128(5.0)).to!double.approxEqual(poissonPMF(i, 5.0)));
}

See Also

Meta