How to get the best fitting curve for my particular data?
Ältere Kommentare anzeigen
I have a set of X and Y data which are some points on 2d plane. The problem is in my data, the Y values are not always increasing with the X axis values. They go to the maximum value of X and after that X values start to be decreased. Y values follow the same story. How I can find the best fitting curve for these points?

What I want to do is to get rid of those crowded and messy part of the graphs and just have a curve to show the trend of each color.
11 Kommentare
Star Strider
am 14 Apr. 2021
What process produced them?
A mathematical model of that process is the best model to fit the data.
Ehsan Ben
am 14 Apr. 2021
Star Strider
am 14 Apr. 2021
What parameters of what functions do you want to estimate in order to fit the data?
Ehsan Ben
am 14 Apr. 2021
Star Strider
am 14 Apr. 2021
What parameters of what functions do you want to estimate in order to fit the data?
We currently have neither the functions or the parameters.
the cyclist
am 14 Apr. 2021
This is pretty confusing to me, and I agree with @Star Strider that we need a better understanding of the generative process. @Ehsan Ben, you are posting a very minimal amount of information here. Instead, you should be making a lot more effort to help us understand your problem.
For example
- there is no explanation of what corresponds to X in your plot
- there is no explanation of which variable corresponds to the different colored lines
- when you say "best fitting curve", it is very unclear what you mean, because you have data points that lie along five curves
- for your phi matrices, you don't explain if these are parameters, or constants, etc
People here are very willing to help out ... but you need to do more to help us understand your problem
Ehsan Ben
am 14 Apr. 2021
the cyclist
am 14 Apr. 2021
Bearbeitet: the cyclist
am 14 Apr. 2021
That's helpful. So, to take one color as you suggest, you want to fit the red points in this region.(Right?)

Ehsan Ben
am 15 Apr. 2021
the cyclist
am 15 Apr. 2021
An important thing to realize is the following. If you say, "Any curve is fine, as long as it fits", then we could create a function that has hundreds of free parameters, bears no relation to your problem, and goes through every single red point. It could be a "perfect" fit.
Similarly, if you say, "I want the simplest possible fit", then we could create just a straight line.
But presumably neither of these extremes is very helpful. Usually, what you want is a function that theoretically makes sense, given how the data were generated. From the infinite universe of possible functions to fit your data, you need to narrow it down to what is useful for why you are doing the fit in the first place. What is the purpose of this fitted line?
Mathieu NOE
am 15 Apr. 2021
hi everybody
sorry to interfere lately in this discussion, but I wonder if the original goal was more about smoothing the cloudy area - rather than fitting an equation to the data; a much simpler task (IMHO)
Antworten (0)
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
