I am trying to build a windows phone 7 app with vb.net
And i need to clear my listbox:
932 100 592 21 924 641 200 1230 5200 842 951 658
I would like to remove the “wrong numbers” because i want to get the average.
In this case the wrong numbers are:
too low: 100, 21, 200
too high: 5200
I just figure out a way to do this
For each items in listbox
calc the avarage
Next
for each item in listbox
if item < avarage/2 then
remove item
end if
if item > avarage*2 then
remove item
end if
next
for each item in listbox
calc the avarage
next
This is how to find outliers in a series of values:
Compute the mean of all the points:
mCompute the standard deviation:
sFor each point with value
vifabs(v - m) > sthenvis an outlier.Here is the pseudo code to do that:
Now, you have M values and you can compute their average: