GithubHelp home page GithubHelp logo

bhanditz / random.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ericzhang-cn/random.js

0.0 2.0 0.0 14 KB

Random number generator of many statistical distributions.

Makefile 0.57% JavaScript 99.43%

random.js's Introduction

Build Status

Random number generator of many statistical distributions.

Demo: http://blog.codinglabs.org/demo/distributions.html

Algorithm reference: http://ftp.arl.mil/random/random.pdf

Installation

npm install random-distrib.js

Example

Browsers

<script type="text/javascript" src="/path/to/random.js"></script>

<!-- html -->

<script type="text/javascript">
    var newPoint = random.normal(0, 1);
</script>

Node

var random = require('/path/to/random');
var newPoint = random.normal(0, 1);

Probability Distribution Functions

Continuous Distributions

arcsine(min, max);

beta(v, w, min, max);

cauchy(a, b);

chiSquare(df);

consine(min, max);

doubleLog(min, max);

erlang(b, c);

exponential(a, b);

extremeValue(a, b);

fRatio(v, w);

gamma(a, b, c);

laplace(a, b);

logarithmic(min, max);

logistic(a, b);

lognormal(a, mu, sigma);

normal(mu, sigma);

parabolic(min, max);

pareto(c);

pearson5(b, c);

pearson6(b, v, w);

power(c);

rayleigh(a, b);

studentT(df);

triangular(min, max, c);

uniform(min, max);

userSpecified(usf, xMin, xMax, yMin, yMax);

weibull(a, b, c);

Discrete Distributions

bernoulli(p);

binomial(n, p);

geometric(p);

hypergeometric(n, N, k);

negativeBinomial(s, p);

pascal(s, p);

poisson(mu);

uniformDiscrete(i, j);

random.js's People

Contributors

ericzhang-cn avatar colesbury avatar bluepichu avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.