repl.txt (1414B)
1 2 {{alias}}( t, a, b ) 3 Evaluates the moment-generating function (MGF) for a discrete uniform 4 distribution with minimum support `a` and maximum support `b` at a value 5 `t`. 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 t: 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 MGF. 26 27 Examples 28 -------- 29 > var y = {{alias}}( 2.0, 0, 4 ) 30 ~689.475 31 > y = {{alias}}( -0.2, 0, 4 ) 32 ~0.697 33 > y = {{alias}}( 2.0, 0, 1 ) 34 ~4.195 35 > y = {{alias}}( 0.5, 3, 2 ) 36 NaN 37 > y = {{alias}}( NaN, 0, 1 ) 38 NaN 39 > y = {{alias}}( 0.0, NaN, 1 ) 40 NaN 41 > y = {{alias}}( 0.0, 0, NaN ) 42 NaN 43 44 45 {{alias}}.factory( a, b ) 46 Returns a function for evaluating the moment-generating function (MGF) 47 of a discrete uniform distribution with minimum support `a` and maximum 48 support `b`. 49 50 Parameters 51 ---------- 52 a: integer 53 Minimum support. 54 55 b: integer 56 Maximum support. 57 58 Returns 59 ------- 60 mgf: Function 61 Moment-generating function (MGF). 62 63 Examples 64 -------- 65 > var mymgf = {{alias}}.factory( 6, 7 ); 66 > var y = mymgf( 0.1 ) 67 ~1.918 68 > y = mymgf( 1.1 ) 69 ~1471.722 70 71 See Also 72 -------- 73