Curve fitting tool generating different results with same data
조회 수: 45 (최근 30일)
이전 댓글 표시
I have been using the Curve fitting tool (cftool) to generate best fit equations for real-life data that generally follows exponential decay kinetics with a 'floor', with the equation in the form f(x) = a*exp(-bx) + c. I did my initial data analysis in the spring of 2018 and now have gone back to redo some of the work. Now I am getting different values for the parameters of the equation than I did on the first analysis, although the input data is not changed. I used the curve fitting tool to set certain bounds for the equation (specifically c >/= 0) on both occasions, and although I think I have done everything the exact same, I am not getting the same results for the curve fitting parameters. Has something changed in the curve fitting algorithm or is there a setting that I can change?
댓글 수: 3
Matt J
2019년 4월 28일
Jeffrey Newbill's comment moved here:
Sorry for resurrecting an old comment thread, but I'd like to add in that I right now have a data set that generates new unique values every time I plug in that same data. To clarify, simply reselecting the same variable in the "X data" drop down menu produces a new (though loosely similar) parameter value. I'm not sure why or how, but there are cases where MATLAB produces different results for the same input.
답변 (2개)
John D'Errico
2019년 4월 28일
편집: John D'Errico
2019년 4월 28일
Has nobody answered this question? The common reason why a method produces different results on a repeated start is there was a random element in the method. In the case of the curve fitting toolbox, if you do not specify the starting point for the estimation, then fit uses a RANDOM start point.
If you start ANY optimizer off from a different point, then you need to expect at least slightly different results. The difference may be as small as the convergence tolerances allow. Or, it may be worse, if the problem has multiple local solutions. Sometimes they are all equivalent, although not always. The point is, this is behavior that you SHOULD EXPECT TO SEE HAPPEN. It is entirely natural. Occasionally, your data is so poor that the model is underspecified. In that case, you might see multiple solutions. In the case of such insuffiicent data, then you need to get better data. The hint in this last case is usually that you get many warning messages produced, probably about singular or nearly singular matrices.
Can you avoid such problems? (Assuming your data is at least viable to produce a solution.) That is, can you get the same solution each time? There are two ways to resolve it, if this really bothers you.
- Best is to just provide intelligent starting values of your own. That makes it most possible that you will get a viable solution. Even if you cannot provide something intelligently chosen, then a set of fixed values is an option.
- If you cannot provide starting values at all, then set the starting random seed for the random number generator.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!