Exponential Curve Fitting

• Mar 10th 2011, 05:52 AM
Phugoid
Exponential Curve Fitting
Alright folks.

I feel a bit silly asking this, but maybe the problem is more difficult than I am giving it credit for.

Basically, I'm trying to replicate a function that I found in a PhD thesis for the purposes of research. However, the function is given only as a graph in the thesis, whereas I need the continuous equation for my application. So basically, it's a curve fitting exercise.

The curve is exponential, going through the points [0,0.1], [40,0.15], [50,0.25], and many more.

I think, to get this curve, it needs to be a really general form of the exponential equation, with at least 4 unknowns, possibly 5, to calibrate:

$y = a\times b^{c\times(x+d)}+e$

So, basically, how do I go about calibrating those parameters a, b, c, d, and e to get the curve I want?

The graph I'm trying to emulate is attached below. Any help greatly appreciated!
• Mar 10th 2011, 06:13 AM
Ackbeet
Try this trick:

$y-e=a\,b^{c(x+d)}$

$\dfrac{y-e}{a}=b^{c(x+d)}$

$\ln(y-e)-\ln(a)=\ln(b^{c(x+d)})=c(x+d)\ln(b).$

The variable $v:=\ln(y-e)$ is now a linear function of $x.$

The number $e$ in this case, incidentally, is the horizontal asymptote as $x\to-\infty.$ If you know what that is, that will simplify matters. Otherwise, just try to fit data points to the log plot of your plot there.

Does that help?
• Mar 10th 2011, 06:50 AM
Phugoid
Quote:

Originally Posted by Ackbeet
Try this trick:

$y-e=a\,b^{c(x+d)}$

$\dfrac{y-e}{a}=b^{c(x+d)}$

$\ln(y-e)-\ln(a)=\ln(b^{c(x+d)})=c(x+d)\ln(b).$

The variable $v:=\ln(y-e)$ is now a linear function of $x.$

The number $e$ in this case, incidentally, is the horizontal asymptote as $x\to-\infty.$ If you know what that is, that will simplify matters. Otherwise, just try to fit data points to the log plot of your plot there.

Does that help?

Thanks for this. Although I'm still having trouble, as the resulting linear system is proving difficult to nail down.
• Mar 10th 2011, 07:19 AM
Ackbeet
Can you please provide a listing of data points? That is, something like this:

x y
0 0.101
40 0.15
45 0.18
50 0.235

Only with a lot more data points - at least 10, I'd say, and as accurately as you can measure them. That'd help out a lot.
• Mar 10th 2011, 07:50 AM
Phugoid
Quote:

Originally Posted by Ackbeet
Can you please provide a listing of data points? That is, something like this:

x y
0 0.101
40 0.15
45 0.18
50 0.235

Only with a lot more data points - at least 10, I'd say, and as accurately as you can measure them. That'd help out a lot.

Thanks for your help. I've solved this problem using Genetic Algorithms (why think for yourself when a computer can do it for you!). But out of interest, I'd like to see your solution to this problem. Here are 10 data points:

X
0
5
10
15
20
25
30
35
40
45
50

Y

0.1054
0.1058
0.1064
0.1076
0.1096
0.1132
0.1196
0.1309
0.1510
0.1865
0.25
• Mar 10th 2011, 08:15 AM
Ackbeet
Ok, I've attached a screenshot of what I got out of Excel. Quite a nice polynomial fit to the log plot of the data. The result is this:

$\ln(y)=7.5841\times 10^{-8}x^{4}-1.4579\times 10^{-6}x^{3}+2.8721\times 10^{-5}x^{2}$

$\qquad\qquad+2.3948\times 10^{-4}x-9.7726\times 10^{-1},$ with

$R^{2}=9.9999\times 10^{-1}.$

That's as good a fit as it gets. Here's the plot:

Attachment 21100

I realize this function is not of the form you were looking for, but this is as good as Excel gets.

Quote:

why think for yourself when a computer can do it for you!
Because computers make fast, very accurate, mistakes. You absolutely must know what the computer is doing, and you must have some idea of the result you want to obtain before you can possibly accept its answer. Computers are very stupid: they do what you tell them, not what you want. Big difference!
• Mar 10th 2011, 08:20 AM
Phugoid
Quote:

Originally Posted by Ackbeet
Ok, I've attached a screenshot of what I got out of Excel. Quite a nice polynomial fit to the log plot of the data. The result is this:

$\ln(y)=7.5841\times 10^{-8}x^{4}-1.4579\times 10^{-6}x^{3}+2.8721\times 10^{-5}x^{2}$

$\qquad\qquad+2.3948\times 10^{-4}x-9.7726\times 10^{-1},$ with

$R^{2}=9.9999\times 10^{-1}.$

That's as good a fit as it gets. Here's the plot:

Attachment 21100

I realize this function is not of the form you were looking for, but this is as good as Excel gets.

Because computers make fast, very accurate, mistakes. You absolutely must know what the computer is doing, and you must have some idea of the result you want to obtain before you can possibly accept its answer. Computers are very stupid: they do what you tell them, not what you want. Big difference!

Ah, I see. Indeed this works.

Haha, yes, but very fast and very accurate mistakes are something of a positive characteristic when it comes to using stochastic heuristic optimisation methods like Genetic Algorithms. Don't worry, I'm fully engaged with GAs and how they work, and they seem to have worked very well on this occasion :D.
• Mar 10th 2011, 08:30 AM
Ackbeet
Quote:

Originally Posted by Phugoid
Ah, I see. Indeed this works.

Haha, yes, but very fast and very accurate mistakes are something of a positive characteristic when it comes to using stochastic heuristic optimisation methods like Genetic Algorithms. Don't worry, I'm fully engaged with GAs and how they work, and they seem to have worked very well on this occasion :D.

Jolly good, then. Would you say your problem is now solved?
• Mar 10th 2011, 08:30 AM
Phugoid
Quote:

Originally Posted by Ackbeet
Jolly good, then. Would you say your problem is now solved?

• Mar 10th 2011, 08:31 AM
Ackbeet
You're very welcome. Have a good one!
• Mar 31st 2011, 08:09 PM
florante
Quote:

Originally Posted by Ackbeet
Try this trick:

$y-e=a\,b^{c(x+d)}$

$\dfrac{y-e}{a}=b^{c(x+d)}$

$\ln(y-e)-\ln(a)=\ln(b^{c(x+d)})=c(x+d)\ln(b).$

The variable $v:=\ln(y-e)$ is now a linear function of $x.$

The number $e$ in this case, incidentally, is the horizontal asymptote as $x\to-\infty.$ If you know what that is, that will simplify matters. Otherwise, just try to fit data points to the log plot of your plot there.

Does that help?

Hi,

supposed that I have a set of x & y.
how would one proceeds in finding the constants assuming the the constant $e$ is not known and is one of the desired result.
Any help would be appreciated.

Thanks
• Apr 1st 2011, 02:36 AM
Ackbeet
Well, here's one way. Let's say you have a spreadsheet. You have a column for $x$, and a column for $y$. You then plot the data you have on a log plot. You are able to get $v=mx+b.$ That is, you've done the trick outlined in Post # 2. So now you can include another column, for $v$. But you know that $v=\ln(y-e).$ That implies $e^{v}=y-e,$ or $e=y-e^{v}.$ I would create another column that is equal to $y-e^{v},$ which you can do because everything there is known. Then I'd probably take $e$ to be the average of everything in that column. Make sense?