Generate random variables from a variety of probability distributions. Includes tools to shuffle an array or sample from it.
Functions for sampling random variables from probability distributions. Uses the same function names as R.
npm install --save probability-distributions
var PD = require("probability-distributions");
Log Normal distribution
Negative Binomial distribution
Normal (Gaussian) distribution
Poisson distribution (not recommended for lambda > 100)
Sample (shuffle an array, or select items using optional array of weights)
Uniform distribution (with entropy option for standard uniform)
Uniform limited to whole numbers
Words (generate random words from a library of characters)
Visualization (show the values of a random variable in an animated loop)
This package contains additional distributions marked as "experimental". Use these with extreme caution.