The OpenD Programming Language

rayleighLPDF

Ditto, with scale parameter.

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

Parameters

x T

value to evaluate LPDF

scale T

scale parameter

Examples

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

0.0.rayleighLPDF.shouldApprox == -double.infinity;
0.5.rayleighLPDF.shouldApprox == log(0.4412485);
1.0.rayleighLPDF.shouldApprox == log(0.6065307);
2.0.rayleighLPDF.shouldApprox == log(0.2706706);

// Can also provide scale parameter
0.5.rayleighLPDF(2.0).shouldApprox == log(0.1211541);
1.0.rayleighLPDF(2.0).shouldApprox == log(0.2206242);
4.0.rayleighLPDF(2.0).shouldApprox == log(0.1353353);

See Also

Meta