Talk:Algorithms for calculating variance: Difference between revisions

Content deleted Content added
Reverted to revision 580850245 by Brycehughes (talk): Rvv.
Line 485:
 
[[Special:Contributions/208.77.214.129|208.77.214.129]] ([[User talk:208.77.214.129|talk]]) 21:02, 3 June 2013 (UTC)
 
== Weighted Incremental Algorithm Alternative Incorrect ==
 
<source lang="python">
def weighted_incremental_variance(dataWeightPairs):
...
M2 = M2 + sumweight * delta * R # Alternatively, "M2 = M2 + weight * delta * (x−mean)"
...
</source>
 
I did the math to see if the stated update formula is indeed correct with the alternative mentioned in the comment; I have found that it is not. As such, I propose the alternative comment be removed.
 
If anyone would like me to do show the math of why there are not equivalent, let me know. Basically, the alternative confuses the sumweight of the previous iteration and the sumweight of the current iteration (which is updated after M2 is calculated).