import mir.math.common: log; import mir.test: shouldApprox; 0.0.weibullLPDF(3.0).shouldApprox == log(0.0); 0.5.weibullLPDF(3.0).shouldApprox == log(0.6618727); 1.0.weibullLPDF(3.0).shouldApprox == log(1.103638); 1.5.weibullLPDF(3.0).shouldApprox == log(0.2309723); // Can also provide scale parameter 0.5.weibullLPDF(2.0, 3.0).shouldApprox == log(0.1080672); 1.0.weibullLPDF(2.0, 3.0).shouldApprox == log(0.1988532); 1.5.weibullLPDF(2.0, 3.0).shouldApprox == log(0.2596003);
Computes the Weibull log probability density function (LPDF).