1
$\begingroup$

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?

alt text

  • 1
    By "exponential" do you mean $y_k=ar^{x_k}$ for some numbers $a$ and $r$? I think you mean "sequence" where you wrote "consequence.2010-12-05
  • 0
    @Jonas Meyer you are right it was typo (fixed). thank you.2010-12-05
  • 2
    @igor: You haven't answered the more important question asked by Jonas: What exactly do you mean by "exponential sequence"?2010-12-05
  • 2
    If Jonas' guess is right, this looks like the same question as http://math.stackexchange.com/questions/3625/easy-to-implement-method-to-fit-a-power-function-regression which has a great answer by J.M.2010-12-05
  • 0
    @Rahul: That question involves a power function, not an exponential function.2010-12-05
  • 0
    @Moron Really, @Jonas Meyer I don't know the formula of my curve :(. At least I would be happy to know that this curve displays as exponent (maybe power function) but not x^3. The main goal is detection of tendency (at least), monotonic and satiation. Thank you.2010-12-05
  • 0
    @Jonas: FWIW, the method I proposed in that question could be adapted to this. :) It's a nonlinear fit with one linear and one nonlinear parameter... writing out the solution adapted to this situation will take me a long time, but the rest of you are welcome to adapt my approach to this.2010-12-05

2 Answers 2

4

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)$$

  • 0
    thank you for answer, i am still confused of "plain" form of expressions on this site. J.M., what tool can I use to view your formulas at graphical form?2010-12-05
  • 0
    I'm not sure I understand what you exactly meant by "graphical", @igor...2010-12-05
  • 0
    https://addons.mozilla.org/en-US/firefox/addon/4082/ thank you for help, J.M.!2010-12-05
  • 1
    [Ah, so you wanted something that doesn't require you to memorize $\LaTeX$ syntax @igor...](http://codecogs.com/latex/eqneditor.php)2010-12-05
4

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$.

  • 2
    It works well as an initial guess for a subsequent nonlinear fit, but for most real-world data, I wouldn't trust results from linear regression of transformed variables. (Sadly, the abuse remains widespread!) Still, +1!2010-12-05
  • 0
    @J. M.: Absolutely! Good point.2010-12-05