The OpenD Programming Language

rayleighPDF

Ditto, with scale parameter.

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

Parameters

x T

value to evaluate PDF

scale T

scale parameter

Examples

import mir.test: shouldApprox;

0.0.rayleighPDF.shouldApprox == 0.0;
0.5.rayleighPDF.shouldApprox == 0.4412485;
1.0.rayleighPDF.shouldApprox == 0.6065307;
2.0.rayleighPDF.shouldApprox == 0.2706706;

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

Meta