randgen
Node.js package for generating different kinds of random numbers.
Last updated 7 years ago by robbrit .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install randgen 
SYNC missed versions from official npm registry.

randgen

Node.js package for generating different kinds of random numbers: Uniform, Normal/Gaussian, Poisson, Chi-squared, Cauchy.

Installation:

npm install randgen

Features:

  • Supported distributions: Uniform, Normal, Poisson, Chi-Square, Cauchy
  • Vector versions of all supported distributions

Usage:

Generate Gaussian random numbers:

num = rnorm();     // standard normal
num = rnorm(2, 5); // normal with mean 2 and standard deviation of 5

Chi-Squared:

num = rchisq(4);   // 4 degrees of freedom

Others: runif, rpoisson, rcauchy

You can also generate vectors of random numbers:

nums = rvnorm(100); // generate 100 standard normal values

Others: rvunif, rvchisq, rvpoisson, rvcauchy

It also includes a handy histogram() function to convert an array of numbers into a set of bins:

bins = histogram(data);     // defaults to 10 bins
bins = histogram(data, 20); // 20 bins

LICENSE:

MIT License

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

4 Versions

  • 0.1.0                                ...           7 years ago
  • 0.0.4                                ...           7 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 8
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |