repl.txt (2156B)
1 2 {{alias}}( x, N, K, n ) 3 Evaluates the natural logarithm of the probability mass function (PMF) for a 4 hypergeometric distribution with population size `N`, subpopulation size 5 `K`, and number of draws `n` at a value `x`. 6 7 If provided `NaN` as any argument, the function returns `NaN`. 8 9 If provided a population size `N`, subpopulation size `K`, or draws `n` 10 which is not a nonnegative integer, the function returns `NaN`. 11 12 If the number of draws `n` or the subpopulation size `K` exceed population 13 size `N`, the function returns `NaN`. 14 15 Parameters 16 ---------- 17 x: number 18 Input value. 19 20 N: integer 21 Population size. 22 23 K: integer 24 Subpopulation size. 25 26 n: integer 27 Number of draws. 28 29 Returns 30 ------- 31 out: number 32 Evaluated logPMF. 33 34 Examples 35 -------- 36 > var y = {{alias}}( 1.0, 8, 4, 2 ) 37 ~-0.56 38 > y = {{alias}}( 2.0, 8, 4, 2 ) 39 ~-1.54 40 > y = {{alias}}( 0.0, 8, 4, 2 ) 41 ~-1.54 42 > y = {{alias}}( 1.5, 8, 4, 2 ) 43 -Infinity 44 45 > y = {{alias}}( NaN, 10, 5, 2 ) 46 NaN 47 > y = {{alias}}( 0.0, NaN, 5, 2 ) 48 NaN 49 > y = {{alias}}( 0.0, 10, NaN, 2 ) 50 NaN 51 > y = {{alias}}( 0.0, 10, 5, NaN ) 52 NaN 53 54 > y = {{alias}}( 2.0, 10.5, 5, 2 ) 55 NaN 56 > y = {{alias}}( 2.0, 5, 1.5, 2 ) 57 NaN 58 > y = {{alias}}( 2.0, 10, 5, -2.0 ) 59 NaN 60 > y = {{alias}}( 2.0, 10, 5, 12 ) 61 NaN 62 > y = {{alias}}( 2.0, 8, 3, 9 ) 63 NaN 64 65 66 {{alias}}.factory( N, K, n ) 67 Returns a function for evaluating the natural logarithm of the probability 68 mass function (PMF) of a hypergeometric distribution with population size 69 `N`, subpopulation size `K`, and number of draws `n`. 70 71 Parameters 72 ---------- 73 N: integer 74 Population size. 75 76 K: integer 77 Subpopulation size. 78 79 n: integer 80 Number of draws. 81 82 Returns 83 ------- 84 logpmf: Function 85 Logarithm of probability mass function (PMF). 86 87 Examples 88 -------- 89 > var mylogPMF = {{alias}}.factory( 30, 20, 5 ); 90 > var y = mylogPMF( 4.0 ) 91 ~-1.079 92 > y = mylogPMF( 1.0 ) 93 ~-3.524 94 95 See Also 96 -------- 97