Talk:Algorithms for calculating variance: Difference between revisions

Content deleted Content added
discuss Algorithm II and AlexC's similar algorithm
Line 40:
AlexC
 
:I added this algorithm (as Algorithm II), but without the sum in the second loop -- the sum of the variations from the mean is of course 0 (<math>\sum_i (x_i-\mu)=\sum_i x_i-N\frac 1N \sum_i x_i=0</math>). But perhaps this is a clever sort of compensation, where the errors in ''sum'' and ''sum2'' are known to be (probably, perhaps) correlated, so that subtracting them is a benefit? Still, though, for all datasets where <math>\sigma^2 \not\ll \mu/N</math>, <math>\left|s\right|\ll s_2</math> (as in ''sum'' and ''sum2''), so the gain in accuracy might be irrelevant. And, if the second loop is meant to be the normal variance operation on preconditioned data, why isn't ''sum'' squared at the end? Anyway, if it's a Good Thing that I've omitted, please tell me and/or add it to the article (with explanation!). --[[User:Tardis|Tardis]] 03:26, 9 June 2006 (UTC)
 
----