Browse Source

WelfordMean: remove unnecessary case for first sample

setting the mean to the sample value and then adding 0 is the same as
setting the mean to zero and then add the sample value divided by 1
master
bresch 3 years ago committed by Daniel Agar
parent
commit
67a893ac6d
  1. 4
      src/lib/mathlib/math/WelfordMean.hpp

4
src/lib/mathlib/math/WelfordMean.hpp

@ -49,10 +49,6 @@ public: @@ -49,10 +49,6 @@ public:
// For a new value, compute the new count, new mean, the new M2.
void update(const T &new_value)
{
if (_count == 0) {
_mean = new_value;
}
_count++;
// mean accumulates the mean of the entire dataset

Loading…
Cancel
Save