The OpenD Programming Language

geometricCCDF

Computes the geometric complementary cumulative density function (CCDF).

  1. T geometricCCDF(size_t k, T p)
  2. T geometricCCDF(T x, T p)
    @safe pure @nogc nothrow
    T
    geometricCCDF
    (
    T
    )
    (
    const T x
    ,
    const T p
    )
    if (
    isFloatingPoint!T
    )

Parameters

p T

true probability

Examples

import mir.test: shouldApprox;

geometricCCDF(-1.0, 0.5).shouldApprox == 1.0; // UFCS chaining deduces this as size_t instead of a floating point type
0.geometricCCDF(0.5).shouldApprox == 0.5;
1.geometricCCDF(0.5).shouldApprox == 0.25;
2.geometricCCDF(0.5).shouldApprox == 0.125;

geometricCCDF(-1.0, 0.25).shouldApprox == 1.0; // UFCS chaining deduces this as size_t instead of a floating point type
0.geometricCCDF(0.25).shouldApprox == 0.75;
1.geometricCCDF(0.25).shouldApprox == 0.5625;
2.geometricCCDF(0.25).shouldApprox == 0.421875;
2.5.geometricCCDF(0.25).shouldApprox == 0.421875;

See Also

Meta