UNPKG

@stdlib/stats

Version:

Standard library statistical functions.

73 lines (56 loc) 1.55 kB
{{alias}}( x, x0, Ɣ ) Evaluates the natural logarithm of the probability density function (logPDF) for a Cauchy distribution with location parameter `x0` and scale parameter `Ɣ` at a value `x`. If provided `NaN` as any argument, the function returns `NaN`. If provided `Ɣ <= 0`, the function returns `NaN`. Parameters ---------- x: number Input value. x0: number Location parameter. Ɣ: number Scale parameter. Returns ------- out: number Natural logarithm of PDF. Examples -------- > var y = {{alias}}( 2.0, 1.0, 1.0 ) ~-1.838 > y = {{alias}}( 4.0, 3.0, 0.1 ) ~-3.457 > y = {{alias}}( 4.0, 3.0, 3.0 ) ~-2.349 > y = {{alias}}( NaN, 1.0, 1.0 ) NaN > y = {{alias}}( 2.0, NaN, 1.0 ) NaN > y = {{alias}}( 2.0, 1.0, NaN ) NaN // Negative scale parameter: > y = {{alias}}( 2.0, 1.0, -2.0 ) NaN {{alias}}.factory( x0, Ɣ ) Returns a function for evaluating the natural logarithm of the probability density function (logPDF) of a Cauchy distribution with location parameter `x0` and scale parameter `Ɣ`. Parameters ---------- x0: number Location parameter. Ɣ: number Scale parameter. Returns ------- logpdf: Function Function to evaluate the natural logarithm of the PDF. Examples -------- > var mylogPDF = {{alias}}.factory( 10.0, 2.0 ); > var y = mylogPDF( 10.0 ) ~-1.838 See Also --------