# Multi-term exponential curve fit

Good day everyone.

On a simple 2D chart with the horizontal axis as the time t. Let's say you have a few data points available. A function F(t) must pass through each one of these data points. This function must tend to 0 as t tends to infinity.

It would be desirable to express the function F(t) as a summation of exponential decay functions with different time constants:

$$F(t) = \sum_{i=0}^n f_i(t) = \sum_{i=0}^n A_ie^{-\alpha_it}$$

By looking at the function above; for each data point $i$, there are two unknown coefficients $A_i$ and $\alpha_i$ to be solved. There are twice as many unknowns as there are data points.

It is possible to generate as many data points as we would like.

How can we find an analytical solution to $A_i$ and $\alpha_i$, such that if I have defined the complete function $F(t)$, I can integrate it between a lower bound $b$ and infinity.

I have tried many things. It might be helpful to express the exponential as a series: $$e^x = \sum_{i=0}^{\infty} \frac{x^n}{n!}$$

Assuming you have exact equality in the first equation, i.e. your data have been generated using the equation you have written, then in matrix form, you can write $$F = XA$$ where $$F = \begin{bmatrix} F(0) \\ \vdots \\ F(T-1) \end{bmatrix}$$ $$X = \begin{bmatrix} 1 & 1 & \ldots & 1\\ e^{-\alpha_0} & e^{-\alpha_1} & \ldots & e^{-\alpha_n }\\ e^{-2\alpha_0} & e^{-2\alpha_1} & \ldots & e^{-2\alpha_n } \\ \vdots & \vdots & \ldots \vdots \\ e^{-(T-1)\alpha_0} & e^{-(T-1)\alpha_1} & \ldots & e^{-(T-1)\alpha_n } \end{bmatrix}$$ and $$A = \begin{bmatrix} A_1 \\ \vdots \\ A_n \end{bmatrix}$$ Assuming $X$ is given (I known it's not) and $T \geq n+1$, the solution of $A$ is $$A = (X^T X)^{-1}X^T F$$ This means that if you find your $\alpha_0 \ldots \alpha_n$, you could find $A$. Replacing the solution of $A$, we get $$F = X(X^T X)^{-1}X^T F$$ or $$P_{X}^{\perp} F = 0$$ where $$P_{X}^{\perp} = I - X(X^T X)^{-1}X^T$$ Then $(\alpha_0 \ldots \alpha_n)$ should be chosen such that $P_{X}^{\perp} F = 0$. You will need to resort to numerical optimization methods, such as the gradient method or others to find your $(\alpha_0 \ldots \alpha_n)$. I don't believe there is a closed form solution for $\alpha_i$'s.