Deriving Welford's Corrected Sum of Squares

493 Views Asked by At

I am studying Welford's paper on "Note on a Method for Calculating Corrected Sums of Squares and Products" and I am stuck on the following "corrected sum of squares" derivation:

enter image description here

I fully understand how we moved from Equation (1) to Equation (2) but I can't seem to see how we move from Equation (2) to Equation (3). When I expand Equation (2), I get:

enter image description here

which looks nothing like Equation (3) from above. Can anybody spot where I'm overlooking something obvious?

1

There are 1 best solutions below

1
On BEST ANSWER

The last term inside the square bracket of your expansion of equation ($2$) should be $\ \displaystyle\frac{1}{n^2}\big(x_n-m_{(n-1)}\big)^2\ $. What you're probably missing is that $\ \displaystyle m_{(n-1)}=\frac{1}{n}\sum_{i=1}^{n-1}x_i\ $, by definition (on p.419 of Welford's paper), so $$ \sum_{i=1}^{n-1}-\frac{2}{n}\big(x_i-m_{(n-1)}\big)\big(x_n-m_{(n-1)}\big)=0\ . $$ Also, $$ \sum_{i=1}^{n-1}\frac{1}{n^2} \big(x_n-m_{(n-1)}\big)^2=\left(\frac{n-1}{n^2}\right) \big(x_n-m_{(n-1)}\big)^2\ . $$ If you apply these identities to your (corrected) expansion of your equation ($2$) you'll get your equation ($3$).