Skip to content

compute incrmstdev

kgryte edited this page May 12, 2015 · 1 revision

Returns a method to compute a moving sample standard deviation incrementally. window sets the window size, i.e., the number of values over which to compute a moving sample standard deviation.

var data = [ 2, 4, 2, 7, 3 ];

var mstdev = compute.incrmstdev( 3 ),
	sigma;

for ( var i = 0; i < data.length; i++ ) {
	sigma = mstdev( data[ i ] );
	console.log( sigma );
}
console.log( mstdev() );
Clone this wiki locally