Exponential fit by customised equation

1 view (last 30 days)
When I am fiiting my experimental data clicking exponetial fit, then it fits well. But when I am writing the same equation in customised form its not fitting.
  2 Comments
Sushreesmita Mishra
Sushreesmita Mishra on 1 Nov 2019
my values to fit
x = [0 120 240 360 480 600 720 840 960 1080 1200 1320 1440 1560 1680 1800]
y = [1 0.861137 0.747681 0.664806 0.562721 0.485829 0.411907 0.356567 0.272409 0.199405 0.125686 0.100692 0.040232 0.019759 4.32E-05 2.7E-06]
In custom equation section of curve fitting tool the equation with form
a*exp(-b*x)
for y = f(x) returns a poor fit with negative R2 value which is illogical.
On the other hand, inbuilt exponential tool with same form returns a very good fit with R2 = 0.96
My question is that why this difference is seen with same form, i.e. "a*exp(-b*x)", and is the custom equation tool trustable for other forms?

Sign in to comment.

Accepted Answer

Alex Sha
Alex Sha on 1 Nov 2019
Hi, Sushreesmita Mishra, the problem you met is normal. When chose build-in function for data fitting, since "build-in", so Matlab itself know which function user selected, then it can chose proper initial start-value acording to the type of function and the data, in the otherhand, for fitting function customised, Matlab doesn't know the type of the function, thus the initial start-values can not be given properly, it lead to the poor fit as your meeting. Same situation in other packages like OriginPro.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!