cftool two term exponential curve fit doesn't make sense

3 次查看(过去 30 天)
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?

采纳的回答

John D'Errico
John D'Errico 2015-3-26
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.

更多回答(1 个)

Star Strider
Star Strider 2015-3-26
We can’t see all the digits in the coefficients you posted. Are they truly equal? Perhaps you only need one exponential.
  2 个评论
Matthew Pollard
Matthew Pollard 2015-3-26
With one exponential term, my R^2 = 0.97. I need a better curve fit than that, hence using the two term curve fit. Is there a way to see more decimal places on the coefficients?
Star Strider
Star Strider 2015-3-26
I can’t imagine that you would need an value higher than 0.97 with real-world data. The criteria of interest are the residual sum-of-squares, and more importantly, the confidence intervals of the parameters.
Pay close attention to the confidence intervals of the parameters. If any of them include zero (one positive an one negative) that parameter is not needed in the model. That will tell you if you need all the parameters from both exponentials.
You can get more figures in the coefficients (and everything else) by choosing format long e in the Command Window or your script file.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by