JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q33353F
  • License MIT

random number generator for specified confidence interval

Package Exports

  • @hugov/metanorm
  • @hugov/metanorm/index.js
  • @hugov/metanorm/parser.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@hugov/metanorm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

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