Let's say we have the following set of data. 2.33, 2.19, 4.7, 2.69, 2.8, 2.12, 3.01, 2.5, 1.98, 2.34
How do I pick the consistent data from the above sample by eliminating the outliers using JavaScript or any other mathematical method which can be implemented in JavaScript?
I approached the following way of calculating: Average value, Standard deviation, Min value (avg - std dev), Max value (avg + std dev). And considered the data which falls in the range between Min and Max values.
Are there are any better approaches we can follow to obtain accuracy?