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

Unified Diff: tracing/tracing/base/statistics.html

Issue 2341623002: Display Histograms in value-set-table-cells. (Closed)
Patch Set: . Created 4 years, 3 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 | « tracing/trace_viewer.gypi ('k') | tracing/tracing/base/statistics_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/statistics.html
diff --git a/tracing/tracing/base/statistics.html b/tracing/tracing/base/statistics.html
index 26dcf3a6d95273414b433269e153ff7cc107a5b7..de509f7f646a88e35da5df0af8f23ab40700abd5 100644
--- a/tracing/tracing/base/statistics.html
+++ b/tracing/tracing/base/statistics.html
@@ -11,6 +11,7 @@ found in the LICENSE file.
<script>
'use strict';
+
// In node, the script-src for mannwhitneyu above brings in mannwhitneyui
// into a module, instead of into the global scope. Whereas this file
// assumes that mannwhitneyu is in the global scope. So, in Node only, we
@@ -31,6 +32,9 @@ found in the LICENSE file.
<script>
'use strict';
+// TODO(charliea): Remove:
+/* eslint-disable catapult-camelcase */
+
tr.exportTo('tr.b', function() {
var identity = x => x;
@@ -776,7 +780,37 @@ tr.exportTo('tr.b', function() {
return new Statistics.LogNormalDistribution(location, shape);
};
- Statistics.mwu = mannwhitneyu;
+ // p-values less than this indicate statistical significance.
+ Statistics.DEFAULT_ALPHA = 0.05;
+
+ /** @enum */
+ Statistics.Significance = {
+ INSIGNIFICANT: -1,
+ DONT_CARE: 0,
+ SIGNIFICANT: 1
+ };
+
+ /**
+ * @typedef {Object} HypothesisTestResult
+ * @property {number} p
+ * @property {number} U
+ * @property {!tr.b.Statistics.Significance} significance
+ */
+
+ /**
+ * @param {!Array.<number>} a
+ * @param {!Array.<number>} b
+ * @param {number=} opt_alpha
+ * @return {!HypothesisTestResult}
+ */
+ Statistics.mwu = function(a, b, opt_alpha) {
+ var result = mannwhitneyu.test(a, b);
+ var alpha = opt_alpha || Statistics.DEFAULT_ALPHA;
+ result.significance = (result.p < alpha) ?
+ Statistics.Significance.SIGNIFICANT :
+ Statistics.Significance.INSIGNIFICANT;
+ return result;
+ };
return {
Statistics: Statistics
« no previous file with comments | « tracing/trace_viewer.gypi ('k') | tracing/tracing/base/statistics_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698