How do I improve convergence in Fitting my data with Curve Fitting Toolbox?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 9 Apr 2012
Commentato: Alex Sha
il 20 Giu 2019
I am looking for suggestions to improve fitting performance using Curve Fitting Toolbox.
Risposta accettata
MathWorks Support Team
il 25 Apr 2019
Modificato: MathWorks Support Team
il 24 Apr 2019
There are a plethora of issues that influence curve fitting.
1. The most notable is selection of model, either from our curve-fitting library or the user's custom equations. We suggest trying different models to fit the data.
2. Some preprocessing of data prior to fitting curve is helpful. This may include:
- Transforming the response data.
- Removing Infs, NaNs, and outliers.
3. The fitting process is more likely to converge if you supply as much information as possible about the coefficients being estimated:
- Make intelligent guesses as starting values. If you have an idea about the likely coefficient values, then use those as starting values.
- In absence of knowledge of starting values, try a variety of different starting values.
- Try restraining the parameters. For example if you know a parameter has to be positive, placing its lower bound at 0 may lead the iterative process toward a solution that it might not find otherwise.
4. There are various fitting options that you can adjust:
- Try different algorithms.
- Increase the number of iterations or function evaluations allowed.
- Reduce the convergence tolerance.
5. Try also sub-setting the data and fitting different subsets of data separately.
6. Another strategy is to fit a term at a time. So say you think your model is
y = c+ a*exp(b*x) + d*sin(f*x);
Then you might want to fit
y = c + a*exp(b*x)
and then use the resulting coefficients for a, b, and c as starting points when fitting the whole equation
y = c+ a*exp(b*x) + d*sin(f*x);
1 Commento
Alex Sha
il 20 Giu 2019
Excellent explanation, great helpful!Just add one point: optimization algorithms adopted or used are one key factor affecting the goodness for curve fitting. The packages like Baron, Lingo or 1stOpt, Compared with the curve fitting toolbox in Matlab, are much easy for using in data fit, since those softawre have adopted global optimization algorithms, as a result, the guess of initial start-values is no longer required, but with much better results. Just want to know why the fitting toolbox in Matlab does not use global optimization algorithms?
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!