0.0.5 • Published 7 years ago

plot-distribution v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

plot-distribution

plot a distribution given

Install

$ npm install plot-distribution

Test

let plot = require('plot-distribution')
console.log(plot(Math.random))

API pdf(distribution,options) -> String

The function receive a distribution and return a string, the default values to options object are:

options = {
    min: 0,
    max: 1,
    intervals: 1000,
    step: (options.max - options.min)/options.intervals,
    points: 1000
}

distribution function has to be a function that receive a numerically param between min, max. You do not need to pass both params intervals and step, as you can see only is neccessary to pass only one of this params. Using the Math.random function to test we obtain something like:

0.00****************************
0.10****************************
0.20*******************************
0.30*****************************
0.40****************************
0.50*****************************
0.60****************************
0.70****************************
0.80*****************************
0.90*****************************
0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago