The OpenD Programming Language

logisticLPDF

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

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

Parameters

x T

value to evaluate LPDF

location T

location parameter

scale T

scale parameter

Examples

import mir.math.common: log;
import mir.test: shouldApprox;

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

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

See Also

Meta