repl.txt (1840B)
1 2 {{alias}}( p, a, b, c ) 3 Evaluates the quantile function for a triangular distribution with minimum 4 support `a`, maximum support `b`, and mode `c` at a value `x`. 5 6 If `p < 0` or `p > 1`, the function returns `NaN`. 7 8 If the condition `a <= c <= b` is not satisfied, the function returns `NaN`. 9 10 If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`. 11 12 Parameters 13 ---------- 14 p: number 15 Input probability. 16 17 a: number 18 Minimum support. 19 20 b: number 21 Maximum support. 22 23 c: number 24 Mode. 25 26 Returns 27 ------- 28 out: number 29 Evaluated quantile function. 30 31 Examples 32 -------- 33 > var y = {{alias}}( 0.9, -1.0, 1.0, 0.0 ) 34 ~0.553 35 > y = {{alias}}( 0.1, -1.0, 1.0, 0.5 ) 36 ~-0.452 37 > y = {{alias}}( 0.1, -20.0, 0.0, -2.0 ) 38 -14.0 39 > y = {{alias}}( 0.8, 0.0, 20.0, 0.0 ) 40 ~11.056 41 42 > y = {{alias}}( 1.1, -1.0, 1.0, 0.0 ) 43 NaN 44 > y = {{alias}}( -0.1, -1.0, 1.0, 0.0 ) 45 NaN 46 47 > y = {{alias}}( NaN, 0.0, 1.0, 0.5 ) 48 NaN 49 > y = {{alias}}( 0.3, NaN, 1.0, 0.5 ) 50 NaN 51 > y = {{alias}}( 0.3, 0.0, NaN, 0.5 ) 52 NaN 53 > y = {{alias}}( 0.3, 1.0, 0.0, NaN ) 54 NaN 55 56 > y = {{alias}}( 0.3, 1.0, 0.0, 1.5 ) 57 NaN 58 59 60 {{alias}}.factory( a, b, c ) 61 Returns a function for evaluating the quantile function of a triangular 62 distribution with minimum support `a`, maximum support `b`, and mode `c`. 63 64 Parameters 65 ---------- 66 a: number 67 Minimum support. 68 69 b: number 70 Maximum support. 71 72 c: number 73 Mode. 74 75 Returns 76 ------- 77 quantile: Function 78 Quantile function. 79 80 Examples 81 -------- 82 > var myquantile = {{alias}}.factory( 2.0, 4.0, 2.5 ); 83 > var y = myquantile( 0.4 ) 84 ~2.658 85 > y = myquantile( 0.8 ) 86 ~3.225 87 88 See Also 89 -------- 90 91