Node.js examples for Algorithm:Statistics
Get Array Median Deviation
Array.prototype.meddev = function( percent ){ var len = this.length, med = this.median(), arr = [], i = 0; for ( ; i < len; i++ ) arr.push( Math.abs( this[i] - med ) ); if ( percent ) return Math.round( ( ( arr.median() ) / med ) * 100 ); return arr.median(); };