Curve fitting WITHOUT toolbox and removing outliers from data.
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have a set of data (6 x100 array) and would like some advice on the best way to fit a curve to the data.
As you can see on the purple line, the data varies per each incrimental change in X value - often making reading the graph difficult.
What is the standard method of:
(a) - removing outliers from data
(b) - plotting curves of best fit to the data (with outliers removed)
Thanks for any help,
J
0 commentaires
Réponses (1)
John D'Errico
le 28 Août 2019
There is no standard method. Why not? because outliers are different things from what you have normally, and vary for each problem. They come from a different distribution than the normal noise in your data.
Here, it appears that you have a relatively large fraction of outliers, in comparison to the data. Effectively, you don't have outliers! That is just your usual noise.
You ask what is the standard method of plotting data without outliers? You find them. Then you plot only the data that was not an outlier. What else would you do?
There is an rmoutliers tool, in the stats toolbox. But if you have a LOT of outliers, and relatively few, noisy data points, then it won't be of much value.
You can use tools that are designed to work robustly. robustfit is one such tool, again in the stats toolbox. These tools are usually in the form of iteratively reweighted estimators, so they look for data points with large residual to the model you pose, and then downweight them in the next iteration.
Finally, the above comment notes that you need to choose a model. They cannot do that for you. The "curve of best fit" is a meaningless thing, UNLESS you have a model in mind.
2 commentaires
Steven Lord
le 28 Août 2019
There is an rmoutliers tool, in the stats toolbox.
FYI the rmoutliers function is part of MATLAB, you don't need Statistics and Machine Learning Toolbox to use it.
Voir également
Catégories
En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!