UNPKG

@stdlib/stats

Version:

Standard library statistical functions.

81 lines (62 loc) 1.68 kB
{{alias}}( x, α, s, m ) Evaluates the logarithm of the probability density function (PDF) for a Fréchet distribution with shape parameter `α`, scale parameter `s`, and location `m`. If provided `NaN` as any argument, the function returns `NaN`. If provided `α <= 0` or `s <= 0`, the function returns `NaN`. Parameters ---------- x: number Input value. α: number Shape parameter. s: number Scale parameter. m: number Location parameter. Returns ------- out: number Evaluated logPDF. Examples -------- > var y = {{alias}}( 10.0, 1.0, 3.0, 5.0 ) ~-2.72 > y = {{alias}}( -2.0, 1.0, 3.0, -3.0 ) ~-1.901 > y = {{alias}}( 0.0, 2.0, 1.0, -1.0 ) ~-0.307 > y = {{alias}}( NaN, 0.0, 1.0 ) NaN > y = {{alias}}( 0.0, NaN, 1.0 ) NaN > y = {{alias}}( 0.0, 0.0, NaN ) NaN // Negative scale parameter: > y = {{alias}}( 0.0, 0.0, -1.0 ) NaN {{alias}}.factory( α, s, m ) Returns a function for evaluating the logarithm of the probability density function (PDF) of a Fréchet distribution with shape parameter `α`, scale parameter `s`, and location `m`. Parameters ---------- α: number Shape parameter. s: number Scale parameter. m: number Location parameter. Returns ------- logpdf: Function Logarithm of probability density function (PDF). Examples -------- > var mylogPDF = {{alias}}.factory( 2.0, 3.0, 1.0 ); > var y = mylogPDF( 10.0 ) ~-3.812 > y = mylogPDF( 2.0 ) ~-6.11 See Also --------