Least Sequare Fit to an Exponential Relationship

Suppose we have variables  
\[x, \: y\]
  exponentially related, so that  y=Ae^{Bx}
, and we have data points  
\[\{(x_1,y_1),(x_2,y_2),....,(x_n,y_n) \}\]
  from which we wish to find estimates for  
\[A, \: B\]
We can estimate  
\[ln(A), \: B\]
  by transforming to a straight line and using the least square methid, then transforming back. Taking logs gives  
The ith error is  
Squaring these and adding them gives  

Differentiate with respect to  
\[ln(A), \: B\]
  in turn, and equating to zero gives
\[\frac{\partial E}{\partial ln(A)}=2 \sum^n_i ln(y_i)-2B \sum^n_{i=1} x_i -2n ln(A)Fsum =0\]

\[\frac{\partial E}{\partial B}=2 \sum^n_{i=1} ln(y_i)x_i- 2B\sum^n_{i=1} x^2_i -2ln(A) \sum^n_{i=1}x_i=0\]

Dividing by 2 and rearranging into matrix form gives  
\[\left( \begin{array}{ccc}\sum^n_{i=1} x_i & n \\ \sum^n_{i=1} x^2_i & \sum^n_{i=1}x_i \end{array} \right) \begin{pmatrix}B\\ln(A)\end{pmatrix}=\begin{pmatrix}\sum^n_i ln(y_i) \\ \sum^n_{i=1} ln(y_i)x_i \end{pmatrix}\]

\[ \begin{pmatrix}B\\ln(A)\end{pmatrix}={\left( \begin{array}{ccc}\sum^n_{i=1} x_i & n \\ \sum^n_{i=1} x^2_i & \sum^n_{i=1}x_i \end{array} \right)}^{-1} \begin{pmatrix}\sum^n_i ln(y_i) \\ \sum^n_{i=1} ln(y_i)x_i \end{pmatrix}\]

Suppose we have the data points  
\[(1,1.00),(2,1.20),(3,1.80),(4,2.50),(5,3.60),(6, 4.70),(7,6.60),(8,10) \]




The system becomes
\[ \begin{pmatrix}B\\ln(A)\end{pmatrix}={\left( \begin{array}{ccc}36 & 8 \\ 204 & 36 \end{array} \right)}^{-1} \begin{pmatrix}8.62\\ 52.42 \end{pmatrix}= \begin{pmatrix}0.325\\ -0.383 \end{pmatrix}\]

The relationship is  

Add comment

Security code