The OpenD Programming Language

logisticPDF

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

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

Parameters

x T

value to evaluate PDF

location T

location parameter

scale T

scale parameter

Examples

import mir.test: shouldApprox;

logisticPDF(-2.0).shouldApprox == 0.1049936;
logisticPDF(-1.0).shouldApprox == 0.1966119;
logisticPDF(-0.5).shouldApprox == 0.2350037;
logisticPDF(0.0).shouldApprox == 0.25;
logisticPDF(0.5).shouldApprox == 0.2350037;
logisticPDF(1.0).shouldApprox == 0.1966119;
logisticPDF(2.0).shouldApprox == 0.1049936;

// Can also provide location/scale parameters
logisticPDF(-1.0, 2.0, 3.0).shouldApprox == 0.06553731;
logisticPDF(1.0, 2.0, 3.0).shouldApprox == 0.08106072;
logisticPDF(4.0, 2.0, 3.0).shouldApprox == 0.07471913;

Meta