The OpenD Programming Language

weibullLPDF

Computes the Weibull log probability density function (LPDF).

@safe pure nothrow @nogc
T
weibullLPDF
(
T
)
(
const T x
,
const T shape
,
const T scale = 1
)
if (
isFloatingPoint!T
)

Parameters

x T

value to evaluate LPDF

shape T

shape parameter

scale T

scale parameter

Examples

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);

See Also

Meta