npm.io
1.12.0 • Published 5 years ago

make-numbers

Licence
MIT
Version
1.12.0
Deps
3
Size
66 kB
Vulns
1
Weekly
0

Make Numbers

This is a simplistic random variate generator library written in Typescript and compiled to Javascript for distribution. The latest version is always available at https://www.npmjs.com/package/make-numbers.

Install

To install the library, first ensure that you have Npm set up, then simply run

npm install make-numbers

You can import the library into your project using:

const numbers = require('make-numbers')

const normalRV = numbers.normal(mean, stdev)

Configuration

The library exports a setSeed() method which allows you to set the seed of the pseudorandom number generator before conducting your experiments. This allows you to create repeatable experiments by generating a sequence of random numbers repeatably.

Distributions

Normal
const normalRV = numbers.normal(mean, stdev)
Triangular
const triangularRV = numbers.triangular(mode, left, right)
Erlang
const erlangRV = numbers.erlang(n, shape)
Exponential
const exponentialRV = numbers.exponential(lambda)
Weibull
const weibullRV = numbers.weibull(lambda, shape)
Geometric
const geometricRV = numbers.geometric(probabilityOfSuccess)
Negative Binomial
const negbinRV = numbers.negbin(numberOfFailures, probabilityOfSuccess)
Poisson
const poissonRV = numbers.poisson(lambda)

API

Table of Contents

License

MIT

Keywords