0.2.0 • Published 10 years ago

jgauss v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

jgauss

Gaussian distribution formulae in standard normal and general normal. These are useful for bell curving. Bell curves sound like bells!

exports.standard epxorts.general

usage

module.exports two functions.

jgauss.standard needs only the x parameter

jgauss.general needs x, the mean, and the deviation

var gus = require('jgauss')
gus.standard(0) // .397...
gus.general(-2, -2, 1) // same as above, only shifted to left 2
gus.general(0, 0, .2) // narrow deviation at .2, this returns .89ish

example

from test.js

var gus = require('./')

console.log(gus.standard(0))
console.log(gus.general(0, 0, 1))
console.log(gus.general(-1, 0, 1))
console.log(gus.general(1, 0, 1))
console.log(gus.general(0, 0, 1))


console.log('chug', gus.general(0, 0, Math.sqrt(5)))
console.log(gus.general(0, 0, Math.sqrt(.2)))
console.log(gus.general(-2, -2, 1))
//console.log(gus.general(0, 0, .5))