Different results for same equation in curve fitting
조회 수: 6 (최근 30일)
이전 댓글 표시
Why is custom fitting not the same as the exponential default one as shown in the picture? The data fits nicely when I use the 'exp2' instead.
I'm relatively new to MATLAB and this is quite baffling to me as i am unable to use a custom equation as it simply does not fit.
댓글 수: 4
Tzu-Yi Chang
2024년 2월 7일
Hi,
Although this conversation was years ago, but I'd like to ask the same question again.
I have the same issue, and even I maunally select the same start point in my customize equation, the results still different between prepackaged 2nd exponential and customize 2nd exponential. Is there any other trick?
Thanks!
답변 (1개)
TED MOSBY
2024년 6월 9일
Hi Ayushi,
I reproduced the graph using the dataset you had provided for both the custom equation option and the exponential option in the "Curve Fitter Tool" using the equation: a*exp(b*x) + c*exp(d*x).
I kept all the parameters and options in the tool same including the starting point, the fitting algorithm etc got the same graph in both the cases as shown below, also have a look at the results which are similar or have very slight differences which is normal.
Graph for the inbuilt exponential option:
Graph for the custom option:
As you can see there is a difference between the coefficients in the results of both the equations and possible explanation for that is there can be a difference in the internal implementation and the data preprocessing which can depend on the chosen model type. This could include data sampling, scaling of variables, handling of outliers, or even slight differences in how the data points are weighted in the fitting process.
Regarding the equation which you mentioned in the comments later, you can simply use the custom equation option and find out the value. Feel free to play around with the fit options and choose the one which best fits your requirements. Below is the graph of what I tried with the equation: a*exp(-x/T) + c*(T*exp(-x/T)) - c*T + c*x
For more information on the "Curve Fitter Tool", have a look at the documentation here:
Hope this helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!