Skip to content

compute incrvariance

kgryte edited this page May 12, 2015 · 1 revision

Returns a method to compute a sample variance incrementally.

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

var variance = compute.incrvariance(),
	s2;

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