3 point quadratic regression formula

While developing the in-process stormer viscometer, one of my goals is to allow the end user to calibrate the device with 3 fluids of known viscosity. With a bit of help from mathematica, I’ve found the formula and for whoever wants it, it’s posted, also for my own future edification. This formula is meant to convert 3 data points of the form {X1,Y1},{X2,Y2},{X3,Y3} into a form of ax^2+bx+c=y. This is probably the fastest way to do this kind of operation on a microcontroller. Here’s an image of the formula

Reverse Quadratic from data

Reverse Quadratic from data

also, here’s a dirty FreeBasic program using it. regress-3point.bas

Also, for fun I decided to do a cubic version. This is in the form of 4 data points {X1,Y1},{X2,Y2},… converting to ax^3+bx^2+cx+d=y

Cubic equation inverse

Cubic equation inverse

You gotta love Mathematica!!!

This entry was posted in Electronics, Miscellaneous, Work and tagged , , , , , , , , , . Bookmark the permalink.

2 Responses to 3 point quadratic regression formula

  1. John says:

    Where did you find this 3 point regression formula? I am trying to figure out the formula for 11 point regression. E-mail me at john_withey@my.hnu.edu, if anybody on these boards has the formula to calculate such. thanks.

  2. smackaay says:

    I calculated it backwards with gaussian elimination. When I was finished, I plugged it into Mathematica in order to simplify it. Turns out that you can solve it through Mathematica as well, which is what I did for the cubic, 4 point equation. I think what you’re looking for is the Least Squares method, unless of course you’re looking for a solution for the variables to the 10th order. :)
    http://en.wikipedia.org/wiki/Least_squares

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Security Code: