An open-source collection of Probability distribution functions.
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
If this is a brand new project, make sure to create a package.json
first with
the npm init
command.
Installation is done using the
npm install
command:
$ npm install probabilis
Probabilis contains a wide-range of distribution functions:
- Binomial Distribution
- Negative Binomial Distribution
- Bernoulli Distribution
- Geometric Distribution
- Exponential Distribution
- Poisson Distribution
Even more to come!
const probabilis = require('probabilis')
let result = probabilis.Binomial(2, 1, 0.5)
//let result = probabilis.NegativeBinomial(2, 1, 0.5) - Another Example
console.log(result)
- n - Number of occurences
- k - kth occurence
- p - Probability of 1 occurence (Probability of success in other distributions like Bernoulli's)
- s - Discrete value (0 - failure, 1 - success)
- x - A discrete value
- gamma - Mean value
Binomial(n, k, p)
NegativeBinomial(n, k, p)
Bernoulli(p, s)
Geometric(x, p)
Exponential(gamma, x)
Poisson(gamma, x)