Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tools/auto_bisect/math_utils.py

Issue 413393002: Use Welch's t-test to calculate confidence scores in the bisect script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add Chromium copyright notice to ttest.py. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/auto_bisect/ttest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/auto_bisect/math_utils.py
diff --git a/tools/auto_bisect/math_utils.py b/tools/auto_bisect/math_utils.py
index fe94f53583bd255f7ecb07902ab114f863e4380e..c225bdd8597c47d1a47f357309fad03445b4587e 100644
--- a/tools/auto_bisect/math_utils.py
+++ b/tools/auto_bisect/math_utils.py
@@ -57,18 +57,20 @@ def Mean(values):
return TruncatedMean(values, 0.0)
-def StandardDeviation(values):
- """Calculates the sample standard deviation of the given list of values."""
+def Variance(values):
+ """Calculates the sample variance."""
if len(values) == 1:
return 0.0
-
mean = Mean(values)
differences_from_mean = [float(x) - mean for x in values]
squared_differences = [float(x * x) for x in differences_from_mean]
variance = sum(squared_differences) / (len(values) - 1)
- std_dev = math.sqrt(variance)
+ return variance
- return std_dev
+
+def StandardDeviation(values):
+ """Calculates the sample standard deviation of the given list of values."""
+ return math.sqrt(Variance(values))
def RelativeChange(before, after):
« no previous file with comments | « no previous file | tools/auto_bisect/ttest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698