least square method
least square method
(Important)
Since, 𝑥𝑖 , 𝑦𝑗 are known, equations (1) & (2) give two equations in 𝑎 & 𝑏. Solving
for 𝑎 & 𝑏 from (1) & (2) & we obtain the best fit 𝑦 = 𝑎𝑥 + 𝑏.
Important Note:
(A) Equations (1) & (2) are called normal equations.
(B) Removing suffixes 𝑖 from (1) & (2), the normal equations are
𝑎 ∑ 𝑥 + 𝑛𝑏 = ∑ 𝑦 & 𝑎 ∑ 𝑥 2 + 𝑏 ∑ 𝑥 = ∑ 𝑥𝑦
to the form Y = AX + B. Hence, a linear fit is another linear fit in both systems of
co-ordinates.
15. By the method of least squares find the straight line to the data given below :
x 5 10 15 20 25
y 16 19 23 26 30
𝑎 ∑ 𝑥 + 5𝑏 = ∑ 𝑦 …………(1)
𝑎 ∑ 𝑥 2 + 𝑏 ∑ 𝑥 = ∑ 𝑥𝑦 ………….(2)
𝑥 𝑦 𝑥2 𝑥𝑦
5 16 25 80
10 19 100 190
15 23 225 345
20 26 400 520
25 30 625 750
Total 75 114 1375 1885
By Second Form :
𝑥−𝑎 𝑥−15
Let us consider, 𝑋= = where, 𝑎 = 15 (middle point of the column 𝑥)
ℎ 5
𝑦−𝑏 y−23
𝑌= = where, 𝑏 = 23 (middle point of the column 𝑦)
ℎ 5
𝐴 ∑ 𝑋 2 + 𝐵 ∑ 𝑋 = ∑ 𝑋𝑌 ……(6)
∴ 𝑌 = 0.7𝑋 − 0.04
y−23 𝑥−15
= 0.7 × − 0.04 = y − 23 = 0.7𝑥 − 10.5 − 0.2
5 5
y = 0.7𝑥 + 33.3 ………………..…………….(Q)
16. Fit a straight line to the data given below. Also estimate the value of y at x =2.5
x 0 1 2 3 4
y 1 1.8 3.3 4.5 6.3
𝑥 𝑦 𝑥2 𝑥𝑦
0 1 0 0
1 1.8 1 1.8
2 3.3 4 6.6
3 4.5 9 13.5
4 6.3 16 25.2
Total 10 16.9 30 47.1
From the above table, the equations can be re-written as
a = 1.33, b = 0.72
𝑦 = 𝑎𝑥 + 𝑏 = 1.33𝑥 + 0.72
[ These two problems (Q. Nos. 15 & 16) are very important.]