repl.txt (2217B)
1 2 {{alias}}( [n, p] ) 3 Returns a binomial distribution object. 4 5 Parameters 6 ---------- 7 n: integer (optional) 8 Number of trials. Must be a positive integer. Default: `1`. 9 10 p: number (optional) 11 Success probability. Must be a number between `0` and `1`. Default: 12 `0.5`. 13 14 Returns 15 ------- 16 binomial: Object 17 Distribution instance. 18 19 binomial.n: number 20 Number of trials. If set, the value must be a positive integer. 21 22 binomial.p: number 23 Success probability. If set, the value must be a number between `0` and 24 `1`. 25 26 binomial.kurtosis: number 27 Read-only property which returns the excess kurtosis. 28 29 binomial.mean: number 30 Read-only property which returns the expected value. 31 32 binomial.median: number 33 Read-only property which returns the median. 34 35 binomial.mode: number 36 Read-only property which returns the mode. 37 38 binomial.skewness: number 39 Read-only property which returns the skewness. 40 41 binomial.stdev: number 42 Read-only property which returns the standard deviation. 43 44 binomial.variance: number 45 Read-only property which returns the variance. 46 47 binomial.cdf: Function 48 Evaluates the cumulative distribution function (CDF). 49 50 binomial.logpmf: Function 51 Evaluates the natural logarithm of the probability mass function (PMF). 52 53 binomial.mgf: Function 54 Evaluates the moment-generating function (MGF). 55 56 binomial.pmf: Function 57 Evaluates the probability mass function (PMF). 58 59 binomial.quantile: Function 60 Evaluates the quantile function at probability `p`. 61 62 Examples 63 -------- 64 > var binomial = {{alias}}( 8, 0.5 ); 65 > binomial.n 66 8.0 67 > binomial.p 68 0.5 69 > binomial.kurtosis 70 -0.25 71 > binomial.mean 72 4.0 73 > binomial.median 74 4.0 75 > binomial.mode 76 4.0 77 > binomial.skewness 78 0.0 79 > binomial.stdev 80 ~1.414 81 > binomial.variance 82 2.0 83 > binomial.cdf( 2.9 ) 84 ~0.145 85 > binomial.logpmf( 3.0 ) 86 ~-1.52 87 > binomial.mgf( 0.2 ) 88 ~2.316 89 > binomial.pmf( 3.0 ) 90 ~0.219 91 > binomial.quantile( 0.8 ) 92 5.0 93 94 See Also 95 -------- 96