Home     Academics  
Click here to sign in.
 The Ultimate LSU Area Homepage. Monday, January 5, 2009 

LEAST SQUARES CALCULATOR

This application performs the Least Squares calculations as required in PHYS 2108. Although we have made every effort to ensure the accuracy of this application, you should check the answers it generates. We are not responsible for any losses (ie, bad grades) caused by this application. See our Terms of Use.

To find a linear equation for a set of points, enter the x and y values of the points in the boxes below and click submit. You must enter at least three data pairs. The values must be comma delimited! The boxes are filled with sample data.

x values:

y values:

x y xy x2 y2
1 2 2 1 4
2 4 8 4 16
3 6 18 9 36
S = 6 S = 12 S = 28 S = 14 S = 56

Calculations for m
m = [n(S xiyi) - (S xi)(S yi)] / [n(S (xi2)) - (S xi)2]
m = [3(28) - (6)(12)] / [3(14) - (6)2]
m = 2

Calculations for b (y-intercept)
b = [(S yi) - m(S xi)] / n
b = [(12) - 2 (6)] / 3
b = 0

Calculations for Standard Deviations
D = n [S (xi2)] - (Sxi)2
D = 3(14) - (6)2
D = 6

s y2 = [S (yi)2 - b(S (yi)) - m(S (xiyi))] / (n - 2)
s y2 = [56 - 0(12) - 2(28)] / (3 - 2)
s y2 = 0

sm = [(n(s y 2) / D ]1/2
sm = [3 (0) / 6 ]1/2
sm = 0

sb = [[(s y 2)(S(xi) 2)] / D]1/2
sb = [[(0)(14)] / 6 ]1/2
sb = 0

m = 2 ±
b = 0 ±