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);
Ditto, with scale parameter.