MATLAB: Cftool two term exponential curve fit doesn’t make sense

cftool

Hey all. So I'm curve fitting some experimental data in MatLAB using the cftool. This is in R2014b. I'm fitting my data to a two term exponential function such that f(x) = a*exp(b*x) + c*exp(d*x). The curve on the plot looks good. My R squared values are 0.99 . . . but the coefficients make no sense.
a = 4.097e+07
b = -4.806
c = -4.097e+07
d = -4.806
Based on the above formula for a two term exponential, for an x value f(x) = 0. I can't extract these coefficients and use them elsewhere because they don't make sense and they don't produce the curve fit that cftool graphs that has the R^2 = 0.99 . . . Am I missing something?

Best Answer

It is good to think about the parameters that come back. Does what you got make sense? Never just accept what a computer gives you without applying a mental filter to it.
So, what has happened here? It turns out that IF you look carefully at the parameters, to full precision, you will see a difference. The differences between those terms is tiny, and with those huge coefficients, it tells me that the solver managed to overfit the problem. Sadly, this fit is meaningless, and I would argue useless. You might as well use a spline, or some other tool.
If you really are wedded to an exponential model BECAUSE the parameters are necessary for other purposes, then these coefficients are useless anyway. They have no meaning, EXCEPT that they managed to squeeze a slightly lower residual error out of the model, FOR that set of data. Yes, sometimes people need a rate parameter from a model, and this is why they use an exponential model. But those model parameters offer no meaning at all in that context.
I'd prefer to play with the data (or at least look at it) before trying to suggest a better model. But essentially, if your goal is purely to get a good fit, then use a tool that can fit your data well instead of trying to force an exponential model to fit by just throwing extra parameters at the curve fit. My suggestion would probably be a spline model, specifically my SLM toolbox (found on the File Exchange), because you can control the basic shape of that curve.