import mir.math.common: log; import mir.test: shouldApprox; logNormalLPDF(1.0).shouldApprox == log(0.3989423); logNormalLPDF(2.0).shouldApprox == log(0.156874); logNormalLPDF(3.0).shouldApprox == log(0.07272826); // Can include location/scale logNormalLPDF(1.0, 1, 2).shouldApprox == log(0.1760327); logNormalLPDF(2.0, 1, 2).shouldApprox == log(0.09856858); logNormalLPDF(3.0, 1, 2).shouldApprox == log(0.06640961);
Ditto, with location and scale parameters (by standardizing x).