hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yanghong Zhong <nju_y...@apache.org>
Subject Issues related to usage of the Welford method in org.apache.hadoop.metrics2.util.SampleStat
Date Tue, 26 Jul 2016 05:35:55 GMT
Hi Team,

In SampleStat, I found the Welford method is used to calculate the variance
in the following method.

public SampleStat add(long nSamples, double x)

I don't understand the meaning of the parameter *x*. Does it mean the sum
of the n samples. If so, I think the new mean calculated by

a1 = a0 + (x - a0) / numSamples

is not correct. It should be

a1 = a0 + (x - nSamples * a0) / numSamples

. However, there's no way to calculate the new variance.

Could you help me to understand the equations? Thanks very much in advance.

Best regards,
Yanghong Zhong

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message