Regression of the form $y=a-be^{-x}$

73 Views Asked by At

Say we have the points $(x_1,y_1),(x_2,y_2),(x_3,y_3),\dots,(x_n,y_n)$ and we need to find the best fit equation that is of the form $y=a-be^{-x}$ (the red curve). See the illustration plot:

enter image description here

Based on least-squares, how to get the values of $a$ and $b$, theoretically, without using softwares?

Your help would be really appreciated. THANKS!

2

There are 2 best solutions below

3
On BEST ANSWER

Let $t_i=e^{-x_i}$ and the model is just $$y=a-bt$$ which is easy.

0
On

You have $a$ and $b$ as linear coefficients, meaning that $$ a\cdot x_m+b\cdot e^{-x_m} = y_m $$ should be fulfilled for every $m\in \{1, \cdots, n\}$. Rewriting this as a matrix equation gives \begin{align} \begin{pmatrix}x_1 &e^{-x_1} \\ x_2 &e^{-x_2}\\ \vdots \\ x_n &e^{-x_n}\\ \end{pmatrix} \cdot \begin{pmatrix}a\\b\end{pmatrix} &= \begin{pmatrix}y_1\\\vdots \\y_n \end{pmatrix}\\ A\cdot x &= b \end{align} which is an over-determined system of linear equations with no guaranteed solution (at least if $n>2$).

In order to obtain a least-squares solution with minimal $\|Ax-b\|_2$, you usually set up normal equations $A^TA x=A^Tb$ and solve them. ou can alleviate numerical instabilities by using the QR-decomposition of $A$, but this is definitely not advisable by hand.