Download presentation
Presentation is loading. Please wait.
Published byAlaina Harrington Modified over 9 years ago
1
Linear Regression Line of Best Fit
2
Gradient = Intercept =
3
Consider the following graph
6
d1d1 d2d2 d3d3 d4d4 d6d6 d5d5 d8d8 d7d7
7
We want a Line where d 1 - d 7 has the minimum distance d1d1 d2d2 d3d3 d4d4 d6d6 d5d5 d8d8 d7d7
8
Just adding will not do it A better method is to square the error S = d21d21 + d 2 2 + d 2 3 + d 2 5 + d 2 4 + d 2 6 We now need to find when ‘S’ is a ‘minimum’
9
S = d2id2i = y – (ax + b) 2 = y – ax - b 2
10
= 2 S Ignoring the summation sign = ds da 2(y – ax – b). (-x) = ds db 2(y – ax – b). (-1)
11
We need to find when these are = zero = ds da 2(y – ax – b). (-x) 0 = (y – ax – b). (-x) 0 = (-yx + ax 2 + bx).
12
We need to find when these are = zero = ds db 2(y – ax – b). (-1) 0 = (y – ax – b). (-1) 0 = (- y + ax + b).
13
This this gives us two equations 0 = (- y + ax + b) 0 = (-yx + ax 2 + bx) Rearranging gives y = + ax + b yx = + ax 2 + bx This is a set of simultaneous equations and can be solved for ‘a’ and ‘b’
14
Put back the Summation signs y = ax + b yx = ax 2 + bx This can be rearranged yx = a. x 2 + b. x y = a. x + bn Now solve for ‘a’ and ‘b’
15
Gradient = Intercept =
16
Easy Try an Example
17
nxy Freq Inductive reactance 150 30 2100 65 3150 90 4200 130 5250 150 6300 190 7350 200 Plot your data Consider the following data Not very straight
18
Make two new columns Use Method of Least Squares xyx2x2 15002500 650010000 1350022500 2600040000 3750062500 5700090000 70000122500 nxy Freq Inductive reactance 150 30 2100 65 3150 90 4200 130 5250 150 6300 190 7350 200 1400 855 212000 350000 Now for y = a. x + b where
19
Use Method of Least Squares xyx2x2 15002500 650010000 1350022500 2600040000 3750062500 5700090000 70000122500 nxy Freq Inductive reactance 150 30 2100 65 3150 90 4200 130 5250 150 6300 190 7350 200 1400 855 212000 350000 Find ‘ a ‘ a = 7 x 212000- 1400 x 855 7 x 350000 - (1400) 2 a = 0.5857
20
Use Method of Least Squares xyx2x2 15002500 650010000 1350022500 2600040000 3750062500 5700090000 70000122500 nxy Freq Inductive reactance 150 30 2100 65 3150 90 4200 130 5250 150 6300 190 7350 200 1400 855 212000 350000 Find ‘ b ‘ b = 855 x 350000- 1400 x 212000 7 x 350000 - (1400) 2 b = 5
21
Use Method of Least Squares xyx2x2 15002500 650010000 1350022500 2600040000 3750062500 5700090000 70000122500 nxy Freq Inductive reactance 150 30 2100 65 3150 90 4200 130 5250 150 6300 190 7350 200 1400 855 212000 350000 Line of best fit 5034.29 10063.57 15092.86 200122.14 250151.43 300180.71 350210.00 Make two more columns y = a. x + b New values for ‘y’ are found from Plot this new data on the original graph
23
Easy
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.