So, I recently became interested in the number $e$ and wanted to get an expression that when applied to an investment gave the "equivalent instantaneous rate". The equation is:
$$EIR = f_{y}\ln{\left(1 + \frac {i}{f_y}\right)}$$
Where $f_{y}$ is the yearly frequency and $i$ the interest. So $e^{EIR} -1$ gives the same value as the effective annual interest rate :
$$EAIR = \left(1+ \frac {i}{f_{y}}\right)^{f_{y}}-1$$
The interesting thing is that I think you can use the EIR equation to get an exponential fit to data that follows an exponential trend. Lets call this data $d$:
$$f_y = 1$$ $$\text{Domain}_d = [a, b]$$ $$i = \frac{d_b-d_a}{d_a}$$
Given this we have:
$$EIR = \ln{\left(1 + i\right)}$$
And a fit for $e$ would be:
$$\large { d_a e^{\ln{\left(1 + i\right)}\frac {x-a}{b-a}}}$$
Now I would like to also combine this with a linear regression, but with one that always underestimates (that is always less or equal) the data, and ideally without having to iterate through the array. I like this method because it seems to be O(1). But I haven't confirmed if it is theoretically correct (for exponentials with clean data. If there is noise in the last or first point the estimation will be wrong, it also doesn't work for non exponential data, is very funny to see the resulting exponential when it tries to fit it to a line). The fact that exponential functions generate such big numbers is making it a bit harder for me to confirm it works.