The OpenD Programming Language

logisticCDF

Ditto, with location and scale parameters (by standardizing x).

  1. T logisticCDF(T x)
  2. T logisticCDF(T x, T location, T scale)
    @safe pure nothrow @nogc
    T
    logisticCDF
    (
    T
    )
    (
    const T x
    ,
    const T location
    ,
    const T scale
    )
    if (
    isFloatingPoint!T
    )

Parameters

x T

value to evaluate CDF

location T

location parameter

scale T

scale parameter

Examples

import mir.test: shouldApprox;

logisticCDF(-2.0).shouldApprox == 0.1192029;
logisticCDF(-1.0).shouldApprox == 0.2689414;
logisticCDF(-0.5).shouldApprox == 0.3775407;
logisticCDF(0.0).shouldApprox == 0.5;
logisticCDF(0.5).shouldApprox == 0.6224593;
logisticCDF(1.0).shouldApprox == 0.7310586;
logisticCDF(2.0).shouldApprox == 0.8807971;

// Can also provide location/scale parameters
logisticCDF(-1.0, 2.0, 3.0).shouldApprox == 0.2689414;
logisticCDF(1.0, 2.0, 3.0).shouldApprox == 0.4174298;
logisticCDF(4.0, 2.0, 3.0).shouldApprox == 0.6607564;

Meta