8000 GitHub - johnmeisner/moving-average: Moving Average
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

johnmeisner/moving-average

< 8000 div class="Box-sc-g0xbh4-0 OverviewContent-module__FileResultsList--irMg6 FileResultsList-module__Box_1--ZnWjQ">
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moving-average

Exponential Moving Average for Node.js.

Also suports Moving Variance.

Install

$ npm install moving-average

Use

var timeInterval = 5 * 60 * 1000; // 5 minutes

var MA = require('moving-average');
var ma = MA(timeInterval);

setInterval(function() {
  ma.push(Date.now(), Math.random() * 500);
  console.log('moving average now is', ma.movingAverage());
  console.log('moving variance now is', ma.variance());
});

License

MIT

About

Moving Average

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
0