in reply to Polynomial Trendline / Extrapolation

Just as a rule of thumb, extrapolating the results of a polynomial fit (of higher order than a quadratic) much further than the "delta x" of one data point beyond your data is not a good idea. That means if your data are spaced a month apart, you don't want to extrapolate more than a month past your data set. The reason is that a polynomial of the form:
y = ax + bx**2 + cx**3 + dx**4 and so on
will be dominated by the high order terms outside the range of your data, and rapidly go to infinity (positive or negative). These kinds of functions suck at extrapolation.

There are other functions that are better suited to extrapolation. Without knowing how your data are *supposed* to behave, I'd be hesitant to recommend any offhand.

Update: typo

Replies are listed 'Best First'.
Re^2: Polynomial Trendline / Extrapolation
by lwicks (Friar) on May 30, 2008 at 15:56 UTC
    I agree completely, after Googling extensively and spending too much time on Mathematics sites trying to get my head around it I came away with the general wisdom that extrapolating this way is bad.
    But it makes the pretty trendlines desired by "TheBoss" .

    At present my math-fu is too weak to solve it, so I suspect manually making charts in Excel will be the solution. :-(

    Kia Kaha, Kia Toa, Kia Manawanui!
    Be Strong, Be Brave, Be perservering!

Re^2: Polynomial Trendline / Extrapolation
by Christian_77 (Initiate) on Jul 25, 2008 at 07:06 UTC
    Hi, Can you suggest some better fuctions for polynomial trendline and extrapolation of a stock price data ? Regards, CH
      Here's a discovery i made about polynomial extrapolation (it probably can be derived from Newton's series but i haven't done it nor have i seen it done).

      First, some preliminaries: 3 points can be fit by a unique quadratic polynomial, i.e., parabola. 4 points can be fit by a unique cubic polynomial. n points can be fit by a unique (n+1)th degree polynomial.

      Suppose we have the 3 points x(0)==1, x(1)==4, x(2)==9. These are obviously fit by the quadratic y(x)=x**2. Now the question is: how do you extrapolate x(3)?

      Answer: Form the binomial expansion of (a-b)**3=0 and note the coefficients: Notice that I expand a CUBIC. For a cubic I would expand (a-b)**4, etc

      a**3-3(a**2)b+3ab**2-b**3=0

      The coefficients are 1, -3, +3, -1

      The discovery I made is that these terms correspond in order to the coefficients of x(3), x(2), x(1), and x(0).
      We are trying to determine x(3).

      We then have: x(3) = 3x(2) -3x(1) +x(0), or: x(3) = 3(9)-3(4)+1 = 16

      This method extrapolates the next term of any polynomial where the x intervals are the same size.
        correction to the above:

        The discovery I made is that these terms correspond in order to the MULTIPLIERS needed for x(3), x(2), x(1), and x(0).
        We are trying to determine x(3).