0

I have a list of Double Values(List of distances form a fixed central point), and I repeatedly chuck out some values(based on simple rule of largest value) and see the change in SD.

I would like to calculate it using a rapid/iterative way to calculate SD after removal of a point.

Have read about different incremental approaches to calculate SD/Variance, but all seem to be for updating SD/Variance after addition of a new data value.

http://en.wikipedia.org/wiki/Standard_deviation#Rapid_calculation_methods

How do I determine the standard deviation (stddev) of a set of values?

How to efficiently calculate a running standard deviation?

Community
  • 1
  • 1
karx
  • 507
  • 2
  • 4
  • 16

1 Answers1

0

To calculate SD, you need the sufficient statistics for it: number of data, sum of data, and sum of data squared. So you just need three accumulator variables for those. Then whenever any data are added, you add to those accumulators, and whenever any are removed, you subtract from those accumulators.

If it still doesn't make sense, maybe you can explain more specifically what's the problem.

Robert Dodier
  • 14,751
  • 2
  • 25
  • 42