Outlier detection in small sets

2.7k Views Asked by At

Is there a good algorithm for detecting outliers in small sets of decimal numbers? The best idea I have come up with so far is a kind of recursive standard deviation based approach, but it seems a bit computationally expensive.

I'm using c++, so any existing functionality in say Boost or other maths helper libraries is welcome in your answers.

Thanks.

1

There are 1 best solutions below

0
On

You can do it in O(n) time with an online variance algorithm (http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Online_algorithm) and then a second pass to mark outliers.