How to remove Outliers
Show older comments
Hi everyone. Does anyone know how to detect and remove the outliers? I've tried man ways but I can't. I have to remove the data by Excel but I think that's not enough. Thank youuuu
Accepted Answer
More Answers (2)
John D'Errico
on 29 Nov 2021
0 votes
The obvious answer is to look at the tools provided in MATLAB. Thus RMOUTLIERS, ISOUTLIER, etc. They are provided in the stats toolbox.
Or if you want to do the work yourself, use tools to do local filtering of some sort. For example, a local polynomial model that drops out the point at the center, but predicts a value there. In a time series context, this can reduce to a simple call to CONV with the correct kernel. (Not difficult to compute that kernel either.) Now compare the predicted value to the point left out. Those with large residuals are potential outliers.
You can also use tools for robust regression modeling, then identifying any points with large residuals as a possible outlier.
The data you show appears to have multiple problems though. There appears to be at least one region with a large dropout, an obvious outlier cluster, possibly caused by some sort of equiptment issues. Outlier detection schemes tend to be best at detecting single point outliers. Groups of outliers are far more difficult to detect, because these points all look like the data around them.
You might also look into clustering methods.
And that means you probably need to make an effort to clean up your data manually. Look for problems in the data that are obvious. If possible, then look back at the source of your data to see if there was some reason for the problem.
1 Comment
FYI rmoutliers and isoutlier are part of MATLAB not Statistics and Machine Learning Toolbox.
which rmoutliers
which isoutlier
Sean Harvey
on 21 Mar 2022
Edited: Sean Harvey
on 21 Mar 2022
0 votes
Did you find a way to remove only the outliers (i.e., points away from the S-shaped curve)?
Categories
Find more on Data Preprocessing 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!


