repl.txt (1519B)
1 2 {{alias}}( p, k ) 3 Evaluates the quantile function for a chi-squared distribution with degrees 4 of freedom `k` at a probability `p`. 5 6 If `p < 0` or `p > 1`, the function returns `NaN`. 7 8 If provided `NaN` for any argument, the function returns `NaN`. 9 10 If provided `k < 0`, the function returns `NaN`. 11 12 Parameters 13 ---------- 14 p: number 15 Input probability. 16 17 k: number 18 Degrees of freedom. 19 20 Returns 21 ------- 22 out: number 23 Evaluated quantile function. 24 25 Examples 26 -------- 27 > var y = {{alias}}( 0.8, 1.0 ) 28 ~1.642 29 > y = {{alias}}( 0.5, 4.0 ) 30 ~3.357 31 > y = {{alias}}( 0.8, 0.1 ) 32 ~0.014 33 > y = {{alias}}( -0.2, 0.5 ) 34 NaN 35 > y = {{alias}}( 1.1, 0.5 ) 36 NaN 37 > y = {{alias}}( NaN, 1.0 ) 38 NaN 39 > y = {{alias}}( 0.0, NaN ) 40 NaN 41 42 // Negative degrees of freedom: 43 > y = {{alias}}( 0.5, -1.0 ) 44 NaN 45 46 // Degenerate distribution when `k = 0`: 47 > y = {{alias}}( 0.3, 0.0 ) 48 0.0 49 > y = {{alias}}( 0.9, 0.0 ) 50 0.0 51 52 53 {{alias}}.factory( k ) 54 Returns a function for evaluating the quantile function of a chi-squared 55 distribution with degrees of freedom `k`. 56 57 Parameters 58 ---------- 59 k: number 60 Degrees of freedom. 61 62 Returns 63 ------- 64 quantile: Function 65 Quantile function. 66 67 Examples 68 -------- 69 > var myquantile = {{alias}}.factory( 2.0 ); 70 > var y = myquantile( 0.3 ) 71 ~0.713 72 > y = myquantile( 0.7 ) 73 ~2.408 74 75 See Also 76 -------- 77