Is there a curve fitting algorithm that focuses on fitting one part of the curve well rather than trying to make a good general fit?

43 Views Asked by At

One use case for this would be multi-exponential decay fitting, I'm talking about functions of the type

$ \displaystyle f(t)=\sum_i^N a_i \cdot e^{-t/\tau_i} $

It would be awesome to have a fit algorithm that basically performs a mono-exponential fit, but instead of returning the $a_{Fit}$ and $\tau_{Fit}$ that minimize the sum of the squares of the residuals, it could return a pair of lifetime and amplitude that is actually present in the multi-exponential decay, for example $a_1$ and $\tau_1$.

One very rudimentary idea on how one could go about such an algorithm would be to try and minimize the sum a step function of the residuals:

$$ r_i=y_i-f(x_i,\beta) \\ s_i=\left\{ \begin{array}{lr} 0 & r_i < R\\ 1 & r_i\geq R \end{array} \right. \\ \displaystyle S=\sum_i^Ns_i $$ Where $S$ is the sum to be minimized, $s_i$ is the step function at the point $x_i$, $r_i$ are the residuals, $(x_i,y_i)$ the data pairs, $f$ the fit function and $\beta$ its parameters. Minimizing this sum would lead to a fit algorithm that tries to get as many points fit to the accuracy provided by $R$ (in the step function) as possible. Now this is just something I came up with quickly to explain what sort of algorithm I'm looking for. Does something like that exist?