Choosing a method for nonlinear data-fitting to find parameters
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'm currently trying to fit nonlinear experimental data to find two parameters. Using lsqcurvefit has been working well about 90% of the time, but I wanted to try to improve that. I have found other methods for fitting data, but I'm confused about the differences between them, and how to choose one. I tried using MultiStart in addition to lsqcurvefit, but that did not seem to improve the results. I also tried lsqnonlin without any luck. Do you have any recommendations about other methods/options to try? I have access to the majority of the toolboxes. Some people were discussing the use of robustfit, but I was confused about the implementation of that. Any insight would be greatly appreciated!
0 Commenti
Risposta accettata
Matt J
il 31 Lug 2017
Modificato: Matt J
il 31 Lug 2017
If lsqcurvefit is failing and your objective function is legal (differentiable, etc...), then it must be that you are deriving a bad initial guess in those failure cases. Since it is only a 2 parameter search, you should be able to derive a good initial guess of the optimum just by evaluating the least squares cost function on some coarse grid and either plotting them as a 2D surface or taking the minimum over the samples.
6 Commenti
John D'Errico
il 1 Ago 2017
fminspleas will be more efficient here, as well as more robust, because it need to work with only the one nonlinear parameter, B. That means A does not need a starting value, nor is it really solved for in an iterative sense. This also makes the problem more robust, because the parameter search is now done in a 1-dimensional search space, instead of the 2-d space of the original problem.
You can even take advantage of the model form to use the expm1 function, since expm1(X)=exp(X)-1. This can be more accurate for some values of X. I doubt it is important here though.
funlist = {@(B,xdata) -expm1(-xdata*B)};
Più risposte (1)
Yahya Zakaria mohamed
il 1 Ago 2017
You can use the APP for curve fitting.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177631/image.png)
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177632/image.png)
>>
It fits very well with about 95% I think nothing more You will get.You can generate code from the app and modify it as You wish.
Vedere anche
Categorie
Scopri di più su Least Squares in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!