Different results for same equation in curve fitting
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Tzu-Yi Chang
el 7 de Feb. de 2024
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!
Respuestas (1)
TED MOSBY
el 9 de Jun. de 2024
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 comentarios
Ver también
Categorías
Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!