1.1.5 • Published 5 years ago
probabilis v1.1.5
An open-source collection of Probability distribution functions.
Installation
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 probabilisFeatures / Distributions included
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!
Usage Example
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)Full API
Reference
- 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
1. Binomial Distribution
Binomial(n, k, p)2. Negative Binomial Distribution
NegativeBinomial(n, k, p)3. Bernoulli Distribution
Bernoulli(p, s)4. Geometric Distribution
Geometric(x, p)5. Exponential Distribution
Exponential(gamma, x)6. Poisson Distribution
Poisson(gamma, x)