repl.txt (1940B)
1 2 {{alias}}( p, N, K, n ) 3 Evaluates the quantile function for a hypergeometric distribution with 4 population size `N`, subpopulation size `K`, and number of draws `n` at a 5 probability `p`. 6 7 If `p < 0` or `p > 1`, the function returns `NaN`. 8 9 If provided `NaN` as any argument, the function returns `NaN`. 10 11 If provided a population size `N`, subpopulation size `K` or draws `n` which 12 is not a nonnegative integer, the function returns `NaN`. 13 14 If the number of draws `n` or the subpopulation size `K` exceed population 15 size `N`, the function returns `NaN`. 16 17 Parameters 18 ---------- 19 p: number 20 Input probability. 21 22 N: integer 23 Population size. 24 25 K: integer 26 Subpopulation size. 27 28 n: integer 29 Number of draws. 30 31 Returns 32 ------- 33 out: number 34 Evaluated quantile function. 35 36 Examples 37 -------- 38 > var y = {{alias}}( 0.4, 40, 20, 10 ) 39 5 40 > y = {{alias}}( 0.8, 60, 40, 20 ) 41 15 42 > y = {{alias}}( 0.5, 100, 10, 10 ) 43 1 44 > y = {{alias}}( 0.0, 100, 40, 20 ) 45 0 46 > y = {{alias}}( 1.0, 100, 40, 20 ) 47 20 48 49 > y = {{alias}}( NaN, 40, 20, 10 ) 50 NaN 51 > y = {{alias}}( 0.2, NaN, 20, 10 ) 52 NaN 53 > y = {{alias}}( 0.2, 40, NaN, 10 ) 54 NaN 55 > y = {{alias}}( 0.2, 40, 20, NaN ) 56 NaN 57 58 59 {{alias}}.factory( N, K, n ) 60 Returns a function for evaluating the quantile function of a hypergeometric 61 distribution with population size `N`, subpopulation size `K`, and number of 62 draws `n`. 63 64 Parameters 65 ---------- 66 N: integer 67 Population size. 68 69 K: integer 70 Subpopulation size. 71 72 n: integer 73 Number of draws. 74 75 Returns 76 ------- 77 quantile: Function 78 Quantile function. 79 80 Examples 81 -------- 82 > var myQuantile = {{alias}}.factory( 100, 20, 10 ); 83 > var y = myQuantile( 0.2 ) 84 1 85 > y = myQuantile( 0.9 ) 86 4 87 88 See Also 89 -------- 90