repl.txt (1635B)
1 2 {{alias}}( x, μ, σ ) 3 Evaluates the natural logarithm of the probability density function (PDF) 4 for a normal distribution with mean `μ` and standard deviation `σ` at a 5 value `x`. 6 7 If provided `NaN` as any argument, the function returns `NaN`. 8 9 If provided `σ < 0`, the function returns `NaN`. 10 11 Parameters 12 ---------- 13 x: number 14 Input value. 15 16 μ: number 17 Location parameter. 18 19 σ: number 20 Standard deviation. 21 22 Returns 23 ------- 24 out: number 25 Evaluated logPDF. 26 27 Examples 28 -------- 29 > var y = {{alias}}( 2.0, 0.0, 1.0 ) 30 ~-2.919 31 > y = {{alias}}( -1.0, 4.0, 2.0 ) 32 ~-4.737 33 > y = {{alias}}( NaN, 0.0, 1.0 ) 34 NaN 35 > y = {{alias}}( 0.0, NaN, 1.0 ) 36 NaN 37 > y = {{alias}}( 0.0, 0.0, NaN ) 38 NaN 39 40 // Negative standard deviation: 41 > y = {{alias}}( 2.0, 0.0, -1.0 ) 42 NaN 43 44 // Degenerate distribution centered at `μ` when `σ = 0.0`: 45 > y = {{alias}}( 2.0, 8.0, 0.0 ) 46 -Infinity 47 > y = {{alias}}( 8.0, 8.0, 0.0 ) 48 Infinity 49 50 51 {{alias}}.factory( μ, σ ) 52 Returns a function for evaluating the natural logarithm of the probability 53 density function (PDF) of a normal distribution with mean `μ` and standard 54 deviation `σ`. 55 56 Parameters 57 ---------- 58 μ: number 59 Location parameter. 60 61 σ: number 62 Standard deviation. 63 64 Returns 65 ------- 66 logpdf: Function 67 Logarithm of probability density function (PDF). 68 69 Examples 70 -------- 71 > var myLogPDF = {{alias}}.factory( 10.0, 2.0 ); 72 > var y = myLogPDF( 10.0 ) 73 ~-1.612 74 75 See Also 76 -------- 77