From c8275b9733b449fc75caf56fbed5952a81db6027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B0=E4=B8=83?= Date: Tue, 14 Oct 2014 16:00:08 +0800 Subject: [PATCH] calculateStandardDeviation bugfix --- lib/bp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bp.js b/lib/bp.js index ea62434..ee22825 100644 --- a/lib/bp.js +++ b/lib/bp.js @@ -64,7 +64,7 @@ bp.Statistics.calculateStandardDeviation = function(sample, mean) { sample.forEach(function(x) { deviation += Math.pow(x - mean, 2); }); - deviation = deviation / (sample.length -1); + deviation = deviation / sample.length; deviation = Math.sqrt(deviation); return deviation; };