The OpenD Programming Language

poissonCCDF

Computes the poisson complementary cumulative distrivution function (CCDF).

  1. T poissonCCDF(size_t k, T lambda)
    template poissonCCDF(PoissonAlgo poissonAlgo = PoissonAlgo.direct)
    @safe pure nothrow @nogc
    T
    poissonCCDF
    (
    T
    )
    (
    const size_t k
    ,
    const T lambda
    )
    if (
    isFloatingPoint!T
    )
  2. template poissonCCDF(string poissonAlgo)

Members

Functions

poissonCCDF
T poissonCCDF(size_t k, T lambda)

Parameters

poissonAlgo

algorithm for calculating CCDF (default: PoissonAlgo.direct)

Examples

import mir.math.common: approxEqual;

assert(3.poissonCCDF(6.0).approxEqual(1.0 - (poissonPMF(0, 6.0) + poissonPMF(1, 6.0) + poissonPMF(2, 6.0) + poissonPMF(3, 6.0))));
// Can compute directly with upper incomplete gamma function
assert(3.poissonCCDF!"gamma"(6.0).approxEqual(poissonCCDF(3, 6.0)));
// For large values of k or lambda, can approximate with normal distribution
assert(1_000_000.poissonCCDF!"approxNormal"(1_000_000.0).approxEqual(poissonCCDF!"gamma"(1_000_000, 1_000_000.0), 10e-3));
// Or closer with continuity correction
assert(1_000_000.poissonCCDF!"approxNormalContinuityCorrection"(1_000_000.0).approxEqual(poissonCCDF!"gamma"(1_000_000, 1_000_000.0), 10e-3));

See Also

Meta