UNPKG

@stdlib/stats

Version:

Standard library statistical functions.

72 lines (55 loc) 1.49 kB
{{alias}}( x, k, λ ) Evaluates the logarithm of the probability density function (PDF) for a Weibull distribution with shape parameter `k` and scale parameter `λ` at a value `x`. If provided `NaN` as any argument, the function returns `NaN`. If provided a nonpositive value for `λ` or `k`, the function returns `NaN`. Parameters ---------- x: number Input value. k: number Shape parameter. λ: number Scale parameter. Returns ------- out: number Evaluated logPDF. Examples -------- > var y = {{alias}}( 2.0, 1.0, 0.5 ) ~-3.307 > y = {{alias}}( 0.1, 1.0, 1.0 ) ~-0.1 > y = {{alias}}( -1.0, 4.0, 2.0 ) -Infinity > y = {{alias}}( NaN, 0.6, 1.0 ) NaN > y = {{alias}}( 0.0, NaN, 1.0 ) NaN > y = {{alias}}( 0.0, 0.0, NaN ) NaN > y = {{alias}}( 2.0, 0.0, -1.0 ) NaN {{alias}}.factory( k, λ ) Returns a function for evaluating the logarithm of the probability density function (PDF) of a Weibull distribution with shape parameter `k` and scale parameter `λ`. Parameters ---------- k: number Shape parameter. λ: number Scale parameter. Returns ------- logpdf: Function Logarithm of probability density function (PDF). Examples -------- > var mylofpdf = {{alias}}.factory( 7.0, 6.0 ); > y = mylofpdf( 7.0 ) ~-1.863 See Also --------