- Thread starter djshusko
- Start date

http://www.grc.nasa.gov/WWW/price000/lap/htm/derivation_cubicregression.html

If you google you will find more

I found an old text book from the sixties that displayed a simple method. You can generate a system of equations to find a m order polynomial regression:

E(x) = sum(X)

n*b0+b1*E(x) + b2*E(x^2) + b3*E(x^3) + ... + bm*E(x^m) = E(y)

b0*E(x) + b1*E(x^2) + b2*E(x^3) + b3*E(x^4) + ... + bm*E(x^(m+1)) = E(y*x)

b0*E(x^2) + b1*E(x^3) + b2*E(x^4) + b3*E(x^5) + ... + bm*E(x^(m+2)) = E(y*x^2)

...........

b0*E(x^m) + b1*E(x^(m+1)) + b2*E(x^(m+2)) + b3*E(x^(m+3)) + ... + bm*E(x^2m) = E(y*x^m)

I then used linear algebra to solve for the constants and used those in a y=b0+b1*x+b2*x^2+...+bm*x^m equation.

I was able to create an algorithm for my program that would draw trend lines almost identical to Excel's.

The text was old, so if anyone knows of any flaws, as I'm a programmer and not a statician, please let me know. Thanks.