I've got a sample curve which ends theoretically with decreasing exponential. The curve end falls into noise. The sample points are given in log scale. What I want to do, is to find and fit the linear part of the log curve to retrieve the exponential factor. The trick is that I don't know the starting point neither the ending point of the linear part of the log curve.
The strategy I'm using is to fit a line at each point with at least say 20 points and until the end of the curve is reached. Then from all these regressions, I keep the one with the best determination coefficient.
I did several tests and found that the RMS error increases with the number of points systematically as the curve becomes more and more noisy, so the extracted factor is always computed on the minimum number of samples (20 in this example case).
My question is, is there a more efficient method to compute this factor ? Does increasing the minimum number of samples improve the accuracy of the fit ?
Here a sample curve I want to fit
The computed slope regarding the position in the curve
And the corresponding RMS error