repl.txt (1462B)
1 2 {{alias}}( x, λ ) 3 Evaluates the natural logarithm of the probability mass function (PMF) for a 4 Poisson distribution with mean parameter `λ` at a value `x`. 5 6 If provided `NaN` as any argument, the function returns `NaN`. 7 8 If provided a negative value for `λ`, the function returns `NaN`. 9 10 Parameters 11 ---------- 12 x: number 13 Input value. 14 15 λ: number 16 Mean parameter. 17 18 Returns 19 ------- 20 out: number 21 Evaluated logPMF. 22 23 Examples 24 -------- 25 > var y = {{alias}}( 4.0, 3.0 ) 26 ~-1.784 27 > y = {{alias}}( 1.0, 3.0 ) 28 ~-1.901 29 > y = {{alias}}( -1.0, 2.0 ) 30 -Infinity 31 > y = {{alias}}( 0.0, NaN ) 32 NaN 33 > y = {{alias}}( NaN, 0.5 ) 34 NaN 35 36 // Negative mean parameter: 37 > y = {{alias}}( 2.0, -0.5 ) 38 NaN 39 40 // Degenerate distribution at `λ = 0`: 41 > y = {{alias}}( 2.0, 0.0 ) 42 -Infinity 43 > y = {{alias}}( 0.0, 0.0 ) 44 0.0 45 46 47 {{alias}}.factory( λ ) 48 Returns a function for evaluating the natural logarithm of the probability 49 mass function (PMF) of a Poisson distribution with mean parameter `λ`. 50 51 Parameters 52 ---------- 53 λ: number 54 Mean parameter. 55 56 Returns 57 ------- 58 logpmf: Function 59 Logarithm of probability mass function (PMF). 60 61 Examples 62 -------- 63 > var mylogpmf = {{alias}}.factory( 1.0 ); 64 > var y = mylogpmf( 3.0 ) 65 ~-2.792 66 > y = mylogpmf( 1.0 ) 67 ~-1.0 68 69 See Also 70 -------- 71