I am trying to use MATLAB's fit function to fit a curve through a data set which obviously shows an exponential decay. These are the commands I use:
f = fit(time', intensity', 'exp1'); plot(f, time, intensity); xlabel('time (min)'); ylabel('intensity (a.u.)');
The result looks like this: Fit with 'exp1'.
It seems to me that this is clearly not the best possible fit. If I use
'exp2' instead of
'exp1', the fit is much better: [Image not linked due to restrictions on number of links.]
However, if I'm not wrong, a similarly good fit should be possible with
'exp1' as well. How can I achieve that?
P.S: The respective coefficients are as follows:
General model Exp1: f(x) = a*exp(b*x) Coefficients (with 95% confidence bounds): a = 1517 (1513, 1521) b = -0.003019 (-0.003133, -0.002905) General model Exp2: f(x) = a*exp(b*x) + c*exp(d*x) Coefficients (with 95% confidence bounds): a = 131.7 (126.9, 136.4) b = -0.1347 (-0.1488, -0.1206) c = 1467 (1462, 1473) d = -0.00198 (-0.002086, -0.001875)
I plotted the log of the intensity values over time and it looks like this: log(intensity) over time. Not exactly a straight line. So I guess the
exp1 model is just not suited in this case, right?