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
This commit is contained in:
bresch
2021-12-10 15:10:39 +01:00
committed by Daniel Agar
parent 5468841aa5
commit 67a893ac6d
-4
View File
@@ -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