Monday, May 25, 2009

Lines of Best Fit

When finding a "best fit" straight line I use a cunningly simple method that I have not seen used elsewhere. It gives, to my mind, a better "best fit" than the famous "Least Squares" method that assumes no errors in the independent variable.
My method is this:
Plot all your points, as normal.
Work out the mean x value (xm) and the mean y value (ym)
From all your points, work out the standard deviation in the x values (sx) and the standard deviation in the y values (sy).
The best "best fit" straight line goes through the points [xm,ym] and [xm+sx, ym+sy]. The gradient of the line is sy/sx (but watch for the sign of the gradient).
Easy or what!
Remember where you saw it first.


GC said...

I really can't decide if you drink too much, or not enough. It must be one of them though.

JAT55 said...

I hardly drink at all. Quite a Koala in fact.