3.0.1 • Published 7 years ago

lib-online-statistics v3.0.1

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

A simple class for tracking mean, variance and standard deviation in an online fashion.

Example use

const OnlineStatistics = require('lib-online-statistics');
const o = new OnlineStatistics();
o.observe(1);
console.log(o.mean()); // prints 1
o.observe(2);
console.log(o.mean()); // prints 1.5

Available methods on the object are observe(record) - observe a new data point.

mean() - get the mean so far.

variance(sample = false) - get the variance so far (sample or population).

standardDeviation(sample = false) - get the corrected standard deviation (sample or population).

Can be serialized with JSON.stringify and provides a fromJSON method.

3.0.1

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago