Different results for same equation in curve fitting

4 次查看(过去 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 个评论
Ayushi Sharma
Ayushi Sharma 2021-7-15
I already have a custom equation:
a*exp(-x/T) +c*(T*(exp(-x/T)-1)+x)
I need to find the value of constant 'c'
In the csv attached:
y = dv
and x= t
Tzu-Yi Chang
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
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!

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by