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