| Index: tracing/tracing/base/math/running_statistics.html
|
| diff --git a/tracing/tracing/base/math/running_statistics.html b/tracing/tracing/base/math/running_statistics.html
|
| index 6fa614aa4b4508597a89f0489a0b7e5dd3496584..bf2103f59696c6965f4acfb045eca5dde41eb075 100644
|
| --- a/tracing/tracing/base/math/running_statistics.html
|
| +++ b/tracing/tracing/base/math/running_statistics.html
|
| @@ -38,14 +38,12 @@ tr.exportTo('tr.b.math', function() {
|
| }
|
|
|
| get geometricMean() {
|
| - if (this.meanlogs_ === undefined)
|
| - return 0;
|
| + if (this.meanlogs_ === undefined) return 0;
|
| return Math.exp(this.meanlogs_);
|
| }
|
|
|
| get mean() {
|
| - if (this.count_ === 0)
|
| - return undefined;
|
| + if (this.count_ === 0) return undefined;
|
| return this.mean_;
|
| }
|
|
|
| @@ -62,16 +60,13 @@ tr.exportTo('tr.b.math', function() {
|
| }
|
|
|
| get variance() {
|
| - if (this.count_ === 0)
|
| - return undefined;
|
| - if (this.count_ === 1)
|
| - return 0;
|
| + if (this.count_ === 0) return undefined;
|
| + if (this.count_ === 1) return 0;
|
| return this.variance_ / (this.count_ - 1);
|
| }
|
|
|
| get stddev() {
|
| - if (this.count_ === 0)
|
| - return undefined;
|
| + if (this.count_ === 0) return undefined;
|
| return Math.sqrt(this.variance);
|
| }
|
|
|
| @@ -82,10 +77,11 @@ tr.exportTo('tr.b.math', function() {
|
| this.sum_ += x;
|
|
|
| // The geometric mean is computed using the arithmetic mean of logarithms.
|
| - if (x <= 0)
|
| + if (x <= 0) {
|
| this.meanlogs_ = undefined;
|
| - else if (this.meanlogs_ !== undefined)
|
| + } else if (this.meanlogs_ !== undefined) {
|
| this.meanlogs_ += (Math.log(Math.abs(x)) - this.meanlogs_) / this.count;
|
| + }
|
|
|
| // The following uses Welford's algorithm for computing running mean
|
| // and variance. See http://www.johndcook.com/blog/standard_deviation.
|
|
|