yuanhao / s-deviation

Utility to calculate standard deviation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Coverage

s-deviation

Math utility to calculate standard deviations, especially for fintech.

Install

$ npm install s-deviation

Usage

import sd from 's-deviation'

sd([1, 2, 4, 8], 2)         // [<1 empty item>, 0.5, 1, 2]

sd([1, 2, 3, 4, 5, 6], 4)
// [
//   <3 empty items>,
//   1.118033988749895,
//   1.118033988749895,
//   1.118033988749895
// ]

sd(datum, size)

  • datum Array.<Number> the collection of data
  • size Number the sample size of

Returns Array.<Number> the array of standard deviations.

Related Modules

License

MIT

About

Utility to calculate standard deviation.

License:MIT License


Languages

Language:JavaScript 100.0%