If I have a collection of data points that follow an exponential curve relationship, how can I manually construct the equation that defines the best-fit exponential curve for the data?
3 Answers
I assume you are looking for a curve of the form $y=Ae^{kx}$.
For all your data points $(x_i,y_i)$, compute $w_i=\ln(y_i)$.
Find in the usual way constants $a,b$ such that the line $w=a+bx$ is a line of best fit to the data $(x_i,w_i)$.
Then $e^a$ and $b$ are good estimates for $A$ and $k$ respectively.
Added: "Line of best fit" is a huge subject. We describe a basic method, least squares. The idea is to find numbers $a$ and $b$ which minimize $$\sum_{i=1}^n \left(w_i -(a+bx_i)\right)^2.$$ It turns out that the best $b$ and $a$ are given by the following formulas: $$b=\frac{\sum_{i=1}^n x_iw_i -\frac{1}{n}\left(\sum_{i=1}^n x_i\right)\left(\sum_{i=1}^n w_i\right)}{\sum_{i=1}^n x_i^2 -\frac{1}{n}\left(\sum_{i=1}^n x_i\right)^2}$$ and $$a =\frac{1}{n}\sum_{i=1}^n w_i -\frac{1}{n}b\sum_{i=1}^n x_i,$$ where $b$ is given by the previous formula.
I suggest you look for "least squares" elsewwhere for a more detailed discussion.

- 507,029
If the function to be fitted is y=A*exp(k*x), then a classical linear regression applied to ln(y)=c+k*x directly leads to the goal. If the function is y=A*exp(k*x)+C, this is more difficult. The usual methods of non linear regression requires a guess of the parameters and iterative computation. A different and non classical method doesn't requires guess nor interation. This traightforward method is shown, with a numerical example, pages 17-18 , in the paper : http://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales

- 66,221
- 3
- 37
- 87
-
1Jacquelin's paper here is very direct and clear (if you have at least a little bit of French); there are more general versions of the same approach in JSTOR (1970) and at DOI 10.1002/nme.1620080206 (1974), though you may have to pay for those if your institution doesn't have a subscription. – Norman Gray Feb 06 '15 at 10:25
-
Thank you very much for the information. In fact, the method is not restricted to exponential functions. The exponential case is only one example, as shown in my paper, where several kind of functions are considered in order to show the practical interest of the method in many cases. – JJacquelin Feb 06 '15 at 10:40
-
@JJacquelin Hi, since a lot of time has passed since the initial answer I am wondering whether you have any English version of your paper. – mgus Sep 05 '17 at 02:44
-
@mgus: Since the first edition, some pages were added with more examples. Some were written in English, others in French. The last update is from 2014. Sorry, there is no full English version. – JJacquelin Sep 05 '17 at 05:35
-
What about the case $ C $ is known? Can one still use Linear Least Squares? – Royi Feb 20 '21 at 18:48
-
@ Royi. If C is known let Y=y-C=Aexp(kx) and then Y is known. One can use Linear Least Squares for ln(Y) wrt x. – JJacquelin Feb 20 '21 at 21:01
Assuming your functions are of the form $A e^{bx}$, the first step is to take the log of the data and then compute the line of best fit. The slope of the resulting line will give you a good approximation for $b$. The constant term will give you a good approximation to $\log A$. This may not be the exponential of best fit in the true sense because larger errors for large $x$ will be scaled down when taking the log, depends on your needs.

- 7,325
scattered
. Care to guide please? – bonCodigo May 04 '17 at 03:41