random number generator for specified confidence interval, median and bounds
note that this uses a gaussian Z as seed and not the usual uniform U to facilitate the generation of correlated variables
• Example • API • License
Example
import {default as meta, parse} from './index.js'
const a = meta(1, 4, {ci:0.5})(),
b = parse`1 4 @50%`,
c = meta(1, 4, {min:0}, 0.9)(),
d = parse`[0 1 4 @.9`
e = meta(1, 2, 4)(),
f = parse`1 2 4`(),
g = parse`[0 10% 90% 1]`
API
Arguments |
Returns |
Notes |
...points [,{min, max, ci=.8}] |
rndNumberGenerator |
0 to 3 points |
Arguments |
Notes |
[min] |
Optional, a lower bound |
`[max] |
Optional, an upper bound |
`[ci=0.8] |
Optional, The confidence interval, defaults to 80% |
Returned Function |
Arguments |
Returns |
Notes |
rndNumberGenerator |
[zSeed] |
Number |
Random number |
Where zSeed
is an optional unit normal distribution number
License
MIT © Hugo Villeneuve