I have a sequence of points:
$(x_1, y_1), (x_2, y_2), (x_3, y_3)\cdots$
I would like to know is it exponential sequence and how to get expression of it?
I have a sequence of points:
$(x_1, y_1), (x_2, y_2), (x_3, y_3)\cdots$
I would like to know is it exponential sequence and how to get expression of it?
I suppose it's time to be putting my dough where my pie hole is. This'll be a tad long, and I hope your collective eyes don't glaze over too much!
The way I'd approach the problem of fitting $y=ab^x$ to a given set of points contaminated with error is to do a weighted linear regression, similar to Hans's proposal, but with a tiny wrinkle that is required for reasons similar to what I mentioned in this answer to a related question.
Our linearization here takes the form
$\ln\;y=\ln\;a+x\ln\;b$
Now, since the supplied $y_i$ are in fact $\hat{y}_i\pm\sigma_i$ where the $\hat{y}_i$ are the "true values" obscured by the measurement errors $\sigma_i$ , any application of linearization should take into account that the errors as well as the "true values" are being transformed (in this case, by a logarithm).
We now use the fact that if the $y_i$ are transformed by a function $f(y)$, the $\sigma_i$ are transformed according to $f'(y_i)\sigma_i$.
From this, the objective function that needs to be minimized for a weighted linear fit is
$$f(a,b)=\sum_i{y_i^2\;(\ln\;y_i-\ln\;a-x_i\ln\;b)^2}$$
and the recipe for getting the required $a$ and $b$ now reads as
$$m=\sum_i y_i^2$$
$$\bar{x}=\frac{\displaystyle \sum_i y_i^2 x_i}{m}$$
$$t=\sum_i y_i^2 (x_i-\bar{x})^2$$
$$b=\exp\left(\frac{\displaystyle \sum_i y_i^2\ln\;y_i (x_i-\bar{x})}{t}\right)$$
$$a=\exp\left(\frac{\displaystyle \sum_i y_i^2\ln\;y_i}{m}-b\bar{x}\right)$$
It turns out that to do a nonlinear fit, we don't even need a provisional value for the linear parameter $a$; we can set things up so that the nonlinear expression we have to minimize only involves $b$. We can then use the $b$ returned by the above formula as a seed, have a secant or Newton-Raphson iteration polish that provisional $b$, and use the polished $b$ to get a proper $a$.
Skipping the details (which can be adapted from the derivation I gave in the answer I linked to), the nonlinear equation that has to be solved for $b$ is
$$\left(\sum_i y_i b^{x_i}\right)\left(\sum_i x_i b^{2x_i-1}\right)-\left(\sum_i x_i y_i b^{x_i-1}\right)\left(\sum_i b^{2x_i}\right)=0$$
from which
$$a=\left(\sum_i y_i b^{x_i}\right) / \left(\sum_i b^{2x_i}\right)$$
Set $Y=\ln y$. If the points $(x_k,y_k)$ lie on the curve $y=a e^{bx}$, then the points $(x_k,Y_k)$ lie on the straight line $Y=(\ln a) + bx$.