Quadratic Regression Formula

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Freaks,

I know i've posted about this before, but I can't find my old thread and i'm getting desperate. Can anyone tell me the formula for a non-linear (quadratic) regression line - also known as a line of best fit? I'll take the formula, or ASSEMBLER/BASIC code.

- Dean

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

KC6ETE Dave's Engineering Page: http://www.dvanhorn.org
Microcontroller Consultant specializing in Atmel AVR.
Analog and Digital hardware design.
Custom Palm Applications.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, http://people.hofstra.edu/facult... has the formulas for LINEAR regression (which I can do, but not what I want), but DOES have an online calculator for the Quadratic (Ax^2+Bx+C) Regression. The outputted graph shows this is EXACTLY what I wantr, but I can't get the ^*%( source beacause of the (*&^)(*& frames. Can anyone nick the source from the site for me?

As for https://www.avrfreaks.net/phpBB2/..., this is my original post. The last answer seemed promising, but I couldn't understand it correctly (remember i'm only in year 10 here).

- Dean

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, just got through the frame to the actual source. Can anyone simplify this into BASIC or ASSEMBLER for me? I juts need a function where I hand it two arrays (holding X and Y values respectivly) and it will return the A B and C values.

My brain hurts!

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

http://people.hofstra.edu/facult... is the link to the actual regression calculator, and you can grab the source from there.

Not sure of copy-right issues though...

Regards,

-Colin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you want to fit n data points {(x0,y0),(x1,y1),...,(xn,yn)} to a second degree polynomial: y = f(x) = a0 + a1*x + a2*x^2? Sounds to me like a least squares fitting....

Solve the linear system A^T*A*x = A^T*b

where eq 10 in http://mathworld.wolfram.com/Lea... shows you how to build matrix.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Freaks,

Hmmm. I just want to be able to pass two arrays (one holding X values, the other y values - with the indexes matching up so that X(0) corresponds to y(0)) with BASCOM to give me the A B and C values. I say Quadratic Regression, because my TI-83 calculator gives me the answer to the Ax^2+Bx+C through the QuadReg function. Can anyone help me - I don't want the theory, just the BASIC or ASSEMBLER code or the completed formula.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!