How do I code in matlab the nested loop algorithm for outlier detection
Show older comments
Nested Loop Algorithm
1. The nested-loop algorithm for computing outliers simply computes, for each input point , p.
2. DK(p) is the distance of kth nearest neighbor of the input point p.
3. It then selects the top n points with maximum distance Dk values.
4. In order to compute Dk for points, the algorithm scans the database for each point p.
5. For a point p , a list of k nearest points for p _ is maintained.
6. For each point q from the database, a check is made to see if dist(p,q) is smaller than the kth nearest neighbor so far.
7. If the check succeeds, q is included in the list of the k nearest neighbors for p.
8. If the list contains more than k neighbors, then the point that is furthest away from p is deleted from the list.
9. Assuming a total buffer size of B% of the dataset size, the algorithm divides the entire buffer space into two halves
10. The nested loop algorithm can be made I/O efficient by computing Dk for a block of points together.
ody
Answers (2)
Walter Roberson
on 29 Apr 2014
0 votes
Image Analyst
on 29 Apr 2014
0 votes
Why not just use the Mathworks-supplied outlier detection code: http://www.mathworks.com/matlabcentral/fileexchange/3961-deleteoutliers? Why reinvent the wheel?
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!