jgauss

gaussian distribution in two flavors, standard normal & general normal

Usage no npm install needed!

<script type="module">
  import jgauss from 'https://cdn.skypack.dev/jgauss';
</script>

README

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))