Applied Mathematics for Electrical Engineering (3130908)

BE | Semester-3   Winter-2019 | 26-11-2019

Q1) (c ( ii )) 

Using method of least square, find the best fitting straight line to the given following data.
x 1 2 3 4 5
y 1 3 5 6 5

The normal equations for the straight line y = A + B x are
 
∑y = n A + B ∑ x
 
∑x y = A ∑ x + B ∑ x2
 
So, we need to find the value of ∑ x , ∑ y , ∑ x y  and ∑ x2 to find the value of A and B.
 
x y x y x2
1 1 1 1
2 3 6 4
3 5 1 9
4 6 24 16
5 5 25 25
∑x = 15 ∑y = 20 ∑x y = 71 ∑x2 = 55
 
The normal equations for the straight line are
 
∑y = n A + B ∑ x  ⇒ 20 = 5 A +15 B ......... 1 
 
∑x y = A ∑ x + B ∑ x2 ⇒ 71 = 15 A +55 B ......... 2 
 
By solving equation ( 1 ) and ( 2 ), we have
 
A = 0.7 and B = 1.1
 
Therefore, the best fit line is y = A + Bx = 13.6 x.