repl.txt (1535B)
1 2 {{alias}}( x, a, b ) 3 Evaluates the natural logarithm of the probability mass function (PMF) for a 4 discrete uniform distribution with minimum support `a` and maximum support 5 `b` at a value `x`. 6 7 If `a > b`, the function returns `NaN`. 8 9 If `a` or `b` is not an integer value, the function returns `NaN`. 10 11 Parameters 12 ---------- 13 x: number 14 Input value. 15 16 a: integer 17 Minimum support. 18 19 b: integer 20 Maximum support. 21 22 Returns 23 ------- 24 out: number 25 Evaluated logPMF. 26 27 Examples 28 -------- 29 > var y = {{alias}}( 2.0, 0, 4 ) 30 ~-1.609 31 > y = {{alias}}( 5.0, 0, 4 ) 32 -Infinity 33 > y = {{alias}}( 3.0, -4, 4 ) 34 ~-2.197 35 > y = {{alias}}( NaN, 0, 1 ) 36 NaN 37 > y = {{alias}}( 0.0, NaN, 1 ) 38 NaN 39 > y = {{alias}}( 0.0, 0, NaN ) 40 NaN 41 > y = {{alias}}( 2.0, 3, 1 ) 42 NaN 43 > y = {{alias}}( 2.0, 1, 2.4 ) 44 NaN 45 46 47 {{alias}}.factory( a, b ) 48 Returns a function for evaluating the natural logarithm of the probability 49 mass function (PMF) of a discrete uniform distribution with minimum support 50 `a` and maximum support `b`. 51 52 Parameters 53 ---------- 54 a: integer 55 Minimum support. 56 57 b: integer 58 Maximum support. 59 60 Returns 61 ------- 62 logpmf: Function 63 Logarithm of probability mass function (PMF). 64 65 Examples 66 -------- 67 > var myLogPMF = {{alias}}.factory( 6, 7 ); 68 > var y = myLogPMF( 7.0 ) 69 ~-0.693 70 > y = myLogPMF( 5.0 ) 71 -Infinity 72 73 See Also 74 -------- 75