JSPM

atlas-stddev

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q38536F
  • License Apache-2.0

Calculates the standard deviation of a set of data points.

Package Exports

  • atlas-stddev

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (atlas-stddev) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

atlas-stddev

Calculates the standard deviation of a set of data points.

Travis


install

npm install --save atlas-stddev

why

Breaking up atlas-dataset into standalone functions. This module calculates the standard deviation of an array of numbers:

sigma(V) = sqrt(<V^2> - <V>^2)

examples

from an array of numbers

const stddev = require("atlas-stddev")
console.log(stddev([-2,-1,0,1,2]))
// 1.4142135623730951

from pre-computed mean and mean square

...
const mean = 0;
const rmsSquared = 2;
console.log(stddev(mean, rmsSquared)) // fast
// 1.4142135623730951

caveats

The caller is expected to sanitize input. Any invalid input will not work; the only valid signatures are:

stddev(<Number>, <Number>)
stddev(<Array<Number>>)