4
$\begingroup$

I'm building an application where a specific location is chosen, multiple services are polled to return results for that specific location and shown on a map.

I have the results from the different sources shown in different colours on the map, so you can get a feel for which results are the "best". In this instance "best" is hard to precisely define, but means which are generally the closest to the starting point.

Because everything is lat/lon, I can then, calculate the distance each one is from the starting point. I was thinking calculating the average of the sum of the squares of the distances, as this would favour those result sets who have the closest points. This might skew otherwise good results that have a just a couple of distant outliers, but it's worth a go.

Are there any good algorithms out there that would help in this situation? I've looked at "clustering" algorithms, but they are good for organising data into groups. However, in this case, I already know what the groups are, I just want to know which group is closest to my target point.

$\endgroup$
4
  • 1
    $\begingroup$ You seem to be asking for an algorithm to compute sums of squares of distances. Is that really your question? $\endgroup$
    – whuber
    Jan 27 '14 at 18:06
  • 1
    $\begingroup$ I can calculate the sum of squares of distances. That seemed sensible to me as a naive solution, but then I thought of the outliers that might skew things. So I thought if I asked nicely here, somebody might have had this problem before and there's a standard approach for comparing result sets around a central point. I just don't want to reinvent the wheel :-) $\endgroup$
    – TobyEvans
    Jan 27 '14 at 18:14
  • $\begingroup$ OK, thanks - so my "prediction" (f) would be always be 0 - ideally, everything would be at the start point, and the true value (y) would be the actual distance from that point? $\endgroup$
    – TobyEvans
    Jan 27 '14 at 18:20
  • 1
    $\begingroup$ I see how I can do this now, I'm going to kick the can down the road. Using squares of the deviation will punish outliers, so I'll implement both, see what results both approaches give and see what the rest of the guys think. But it really wasn't that complicated. Thanks $\endgroup$
    – TobyEvans
    Jan 27 '14 at 18:29
0
$\begingroup$

So, you are asking what would be a good statistics to compute accuracy without being too sensible to outliers.

Besides from what you already tried, i.e., calculating the average of the sum of the squares of the distances, you can try the Mean Absolute Error, which is less sensible to outliers as it does not square the deviations. See below:

$$\text{MAE} = \frac{1}{n}\sum_{i=1}^{n}|e_i|$$

where $|e_i|$ are the distances from the multiple services locations to the point of interest (POI).

Regarding algorithms for calculating the MAE statistics from large-data (if is the case), this CV post might help.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.