0.5.2 • Published 4 months ago

@hugov/metanorm v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

metanorm

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

ExampleAPILicense

Example

import {default as meta, parse} from './index.js'

const a = meta(1, 4, {ci:0.5})(),        // normal distribution with 50% of values between 1 and 4
      b = parse`1 4 @50%`,                // same as above
      c = meta(1, 4, {min:0}, 0.9)(),    // lognormal distribution with 90% of values between 1 and 4 (lower bound at 0)
      d = parse`[0 1 4 @.9`               // same as above
      e = meta(1, 2, 4)(),               // an unbounded skewed infinite distribution with a median at 2
      f = parse`1 2 4`(),                 // same as above
      g = parse`[0 10% 90% 1]`            // distribution 'close' to a uniform distribution

API

ArgumentsReturnsNotes
...points [,{min, max, ci=.8}]rndNumberGenerator0 to 3 points
ArgumentsNotes
[min]Optional, a lower bound
`max | Optional, an upper bound
`ci=0.8 | Optional, The confidence interval, defaults to 80%
Returned FunctionArgumentsReturnsNotes
rndNumberGenerator[zSeed]NumberRandom number

Where zSeed is an optional unit normal distribution number

License

MIT © Hugo Villeneuve

0.5.2

4 months ago

0.5.1

4 months ago

0.5.0

5 months ago

0.4.0

5 months ago

0.3.1

5 months ago

0.3.0

5 months ago

0.2.1

5 months ago