The OpenD Programming Language

laplaceCDF

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

  1. T laplaceCDF(T x)
  2. T laplaceCDF(T x, T location, T scale)
    @safe pure nothrow @nogc
    T
    laplaceCDF
    (
    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;

laplaceCDF(-2.0).shouldApprox == 0.06766764;
laplaceCDF(-1.0).shouldApprox == 0.1839397;
laplaceCDF(-0.5).shouldApprox == 0.3032653;
laplaceCDF(0.0).shouldApprox == 0.5;
laplaceCDF(0.5).shouldApprox == 0.6967347;
laplaceCDF(1.0).shouldApprox == 0.8160603;
laplaceCDF(2.0).shouldApprox == 0.9323324;

// Can also provide location/scale parameters
laplaceCDF(-1.0, 2.0, 3.0).shouldApprox == 0.1839397;
laplaceCDF(1.0, 2.0, 3.0).shouldApprox == 0.3582657;
laplaceCDF(4.0, 2.0, 3.0).shouldApprox == 0.7432914;

Meta