A Lecture Notes on
Probability and Statistics:
Curve Fitting
BACHELOR OF ENGINEERING
In
CE/IT/EC
Prepared By
Ms. Mansi G. Vaishnani
Mathematics and Humanities Department
GANDHINAGAR INSTITUTE OF TECHNOLOGY
VILL. MOTI-BHOYAN, KHATRAJ-KALOL RD, TA KALOL, DIST.
GANDHINAGAR-382721
Curve Fitting
Outline
• Introduction
• Least Square Method
• Fitting of Linear Curves
• Fitting of Quadratic Curves
• Fitting of Exponential and Linear Curves
❖ Introduction
➢ Curve fitting is the process of finding “best-fit” curve for a given set of data. It is
representation of mathematical relationship between two variables, which is given by simple
algebraic expression.
𝑖. 𝑒. 𝑦𝑖 = 𝑓(𝑥𝑖 ) , 1 ≤ 𝑖 ≤ 𝑛
➢ In practical given a data in terms of two variables 𝑥, 𝑦. We need to find possible relationship
between values of 𝑥 & 𝑦. In this chapter we discuss method of finding specific relation 𝑦 =
𝑓(𝑥) for the data to satisfy as accurately as possible & such am equation called “Curve of best
fit” or “Best fitting equation”
❖ Least Square Method
➢ Let 𝑦 = 𝑓(𝑥) be an approximate relation that fit into given data (𝑥𝑖 , 𝑦𝑖 ) , 𝑖 = 1,2, … , 𝑛.
𝑦𝑖 ′𝑠 called observed values &
𝑌𝑖 = 𝑓(𝑥𝑖 ) are called expected values.
The difference between observed & expected values are called Residuals or Error or Deviation
or Estimated errors.
𝑑𝑖 = 𝑦𝑖 − 𝑓(𝑥𝑖 )
➢ This method provides relationship 𝑦 = 𝑓(𝑥) such that sum of squares of residuals
[𝐸 = ∑𝑛𝑖=1 𝑑𝑖 2 = ∑𝑛𝑖=1{𝑦𝑖 − 𝑓(𝑥𝑖 )}2 ] is minimum (least).
❖ Fitting of Linear Curve
The normal equations for the straight line 𝑦 = 𝑎 + 𝑏𝑥 are
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥
∑𝑥𝑦 = 𝑎∑𝑥 + 𝑏∑𝑥 2
Example – 1
Fit a straight line to the following data. Also estimate the value of 𝑦 at 𝑥 = 2.5.
𝑥 0 1 2 3 4
𝑦 1 1.8 3.3 4.5 6.3
Solution:
Let the straight line to be fitted to the data be
𝑦 = 𝑎 + 𝑏𝑥
The normal equations are:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥
∑𝑥𝑦 = 𝑎∑𝑥 + 𝑏∑𝑥 2
Here 𝑛 = 5,
𝒙 𝒚 𝒙𝟐 𝒙𝒚
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
∑𝒙 = 𝟏𝟎 ∑𝒚 = 𝟏𝟔. 𝟗 ∑𝒙𝟐 = 𝟑𝟎 ∑𝒙𝒚 = 𝟒𝟕. 𝟏
Substituting these values in the normal equations:
16.9 = 5𝑎 + 10𝑏 − − − −(1)
47.1 = 10𝑎 + 30𝑏 − − − −(2)
Multiply Eq (1) with constant 2,
33.8 = 10 𝑎 + 20𝑏
47.1 = 10𝑎 + 30𝑏
− − −
−13.3 = −10𝑏
−13.3
𝑏=
−10
∴ 𝒃 = 𝟏. 𝟑𝟑 put in Eq (1),
➢ 16.9 = 5𝑎 + 10(1.33)
16.9 − 13.3 = 5𝑎
3.6
𝑎=
5
∴ 𝒂 = 𝟎. 𝟕𝟐
we get, 𝑎 = 0.72 & 𝑏 = 1.33
Then the required straight line is: 𝑦 = 0.72 + 1.33𝑥
For 𝑥 = 2.5 ⟹ 𝑦 = 0.72 + 1.33(2.5)
⟹ 𝑦 = 4.045
Example – 2
By a method of least square, find the straight line that best fits the following data.
𝑥 1 2 3 4 5
𝑦 14 27 40 55 68
Solution:
Let the straight line to be fitted to the data be 𝑦 = 𝑎 + 𝑏𝑥
The normal equations are:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥
∑𝑥𝑦 = 𝑎∑𝑥 + 𝑏∑𝑥 2
Here 𝑛 = 5,
𝒙 𝒚 𝒙𝟐 𝒙𝒚
1 14 1 14
2 27 4 54
3 40 9 120
4 55 16 220
5 68 25 340
∑𝒙 = 𝟏𝟓 ∑𝒚 = 𝟐𝟎𝟒 ∑𝒙𝟐 = 𝟓𝟓 ∑𝒙𝒚 = 𝟕𝟒𝟖
Substituting these values in the normal equations:
204 = 5𝑎 + 15𝑏 … … 𝐸𝑞 (1)
748 = 15𝑎 + 55𝑏 … … 𝐸𝑞 (2)
Multiply Eq (1) with constant 3,
612 = 15𝑎 + 45𝑏
748 = 15𝑎 + 55𝑏
− − −
−136 = −10𝑏
−136
𝑏=
−10
∴ 𝒃 = 𝟏𝟑. 𝟔 put in Eq (1),
204 = 5𝑎 + 15(13.6)
204 − 204 = 5𝑎
∴ 𝒂 = 𝟎. 𝟕𝟐
we get, 𝑎 = 0 & 𝑏 = 13.6
Then the required straight line is: 𝑦 = 13.6 𝑥
Example – 3
If 𝑃 is the pull required to lift a load 𝑊 by means of a pulley block, find a linear law of the form
𝑃 = 𝑚𝑊 + 𝐶 connecting 𝑃 & 𝑊 using the following data.
𝑃 12 15 21 25
𝑊 50 70 100 120
Where 𝑃 & 𝑊 are taken in 𝑘𝑔 − 𝑤𝑡. Compute 𝑃 when 𝑊 = 150 𝑘𝑔
Solution:
Let the linear curve (straight line) to be 𝑃 = 𝑚𝑊 + 𝐶 = 𝐶 + 𝑚𝑊
The normal equations are:
∑𝑃 = 𝑛𝐶 + 𝑚∑𝑊
∑𝑃𝑊 = 𝐶∑𝑊 + 𝑚∑𝑊 2
Here 𝑛 = 4,
𝑷 𝑾 𝑾𝟐 𝑷𝑾
12 50 2500 600
15 70 4900 1050
21 100 10000 2100
25 200 14400 3000
∑𝑷 = 𝟕𝟑 ∑𝑾 = 𝟑𝟒𝟎 ∑𝑾𝟐 = 𝟑𝟏𝟖𝟎𝟎 ∑𝑷𝑾 = 𝟔𝟕𝟓𝟎
Substituting these values in the normal equations:
73 = 4𝐶 + 340𝑚 … … 𝐸𝑞 (1)
6750 = 340𝐶 + 31800𝑚 … … 𝐸𝑞 (2)
Divide Eq (2) with constant 85,
73 = 4𝐶 + 340𝑚
79.41 = 4𝐶 + 374.12𝑚
− − −
−6.41 = −34.12𝑚
∴ 𝒎 = 𝟎. 𝟏𝟖𝟕𝟗 Put in Eq (1)
∴ 73 = 4𝐶 + 340(0.1879)
73 = 4𝐶 + 63.886
4𝐶 = 9.114
∴ 𝑪 = 𝟐. 𝟐𝟕𝟖𝟓
we get, 𝐶 = 2.2785 & 𝑚 = 0.1879
Then the required straight line is: 𝑃 = 0.1879𝑊 + 2.2785
When 𝑊 = 150 𝑘𝑔
⟹ 𝑃 = 0.1879(150) + 2.2785 = 30.4635
❖ Exercises
1. Fit a straight line to the following data. Also estimate the value of 𝑦 at 𝑥 = 2.5.
𝑥 1 2 3 4 6 8
𝑦 2.4 3 3.6 4 5 6
Ans: 𝑦 = 1.9764 + 0.5059𝑥
2. Using method of least squares, find the best fitting straight line to the following data.
𝑥 1 2 3 4 5
𝑦 1 3 5 6 5
Ans: 𝑦 = 0.6937 + 1.1021𝑥
❖ Fitting of Quadratic Curve
➢ The normal equations for the least squares quadratic curve (parabola) 𝑦 = 𝑎 + 𝑏𝑥 + 𝑐𝑥 2 are
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 + 𝑐∑𝑥 2
∑𝑥𝑦 = 𝑎∑𝑥 + 𝑏∑𝑥 2 + 𝑐∑𝑥 3
∑𝑥 2 𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 3 + 𝑐∑𝑥 4
➢ The normal equations for the curve 𝑦 = 𝑎 + 𝑏𝑥 2 are
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 2
∑𝑥 2 𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 4
➢ The normal equations for the curve 𝑦 = 𝑎𝑥 + 𝑏𝑥 2 are
∑𝑥𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 3
∑𝑥 2 𝑦 = 𝑎∑𝑥 3 + 𝑏∑𝑥 4
Example – 1
Fit a second-degree polynomial using the least square method to the following data:
𝑥 0 1 2 3 4
𝑦 1 1.8 1.3 2.5 6.3
Solution:
Let 𝑦 = 𝑎 + 𝑏𝑥 + 𝑐𝑥 2 be the best fit curve to the given data.
Then normal equations are:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 + 𝑐∑𝑥 2
∑𝑥𝑦 = 𝑎∑𝑥 + 𝑏∑𝑥 2 + 𝑐∑𝑥 3
∑𝑥 2 𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 3 + 𝑐∑𝑥 4
Here 𝑛 = 5
𝒙 𝒚 𝒙𝟐 𝒙𝟑 𝒙𝟒 𝒙𝒚 𝒙𝟐 𝒚
0 1 0 0 0 0 0
1 1.8 1 1 1 1.8 1.8
2 1.3 4 8 16 2.6 5.2
3 2.5 9 27 81 7.5 22.5
4 6.3 16 64 256 25.2 100.8
∑𝒙 = 𝟏𝟎 ∑𝒚 ∑𝒙𝟐 = 𝟑𝟎 ∑𝒙𝟑 ∑𝒙𝟒 ∑𝒙𝒚 ∑𝒙𝟐 𝒚
= 𝟏𝟐. 𝟗 = 𝟏𝟎𝟎 = 𝟑𝟓𝟒 = 𝟑𝟕. 𝟏 = 𝟏𝟑𝟎. 𝟑
Substituting these values in the normal equations:
12.9 = 5𝑎 + 10𝑏 + 30𝑐 − − − −(1)
37.1 = 10𝑎 + 30𝑏 + 100𝑐 − − − −(2)
130.3 = 30𝑎 + 100𝑏 + 354𝑐 − − − −(3)
Solving these equations,
(1) × 2 ⟹ 25.8 = 10 𝑎 + 20𝑏 + 60𝑐
(2) × 1 ⟹ 37.1 = 10𝑎 + 30𝑏 + 100𝑐
− − − −
−11.3 = −10𝑏 − 40𝑐 ……..(4)
(2) × 3 ⟹ 111.3 = 30𝑎 + 90𝑏 + 300𝑐
(3) × 1 ⟹ 130.3 = 30𝑎 + 100𝑏 + 354𝑐
− − − −
−19 = −10𝑏 − 54𝑐 ……..(5)
(4) − (5) ⟹ −11.3 = −10𝑏 − 40𝑐
⟹ −19 = −10𝑏 − 54𝑐
+ + +
7.7 = 14𝑐 ……..(5)
∴ 𝑐 = 0.55 put in (4)
➢ −11.3 = −10𝑏 − 40𝑐
−11.3 = −10𝑏 − 40(0.55)
−11.3 = −10𝑏 − 22
10.7 = −10𝑏
𝑏 = −1.07 𝑝𝑢𝑡 𝑖𝑛 (1),
➢ 12.9 = 5𝑎 + 10𝑏 + 30𝑐
12.9 = 5𝑎 + 10(−1.07) + 30(0.55)
5𝑎 = 7.1
𝑎 = 1.42
we get, 𝑎 = 1.42, 𝑏 = −1.07, 𝑐 = 0.55
Therefore, the required curve is: 𝒚 = 𝟏. 𝟒𝟐 − 𝟏. 𝟎𝟕𝒙 + 𝟎. 𝟓𝟓𝒙𝟐
Example – 2
Using method of least squares, Find the best fitting second-degree curve to the following data:
𝑥 1 2 3 4
𝑦 6 11 18 27
Solution:
Let 𝑦 = 𝑎 + 𝑏𝑥 + 𝑐𝑥 2 be the best fit curve to the given data.
Then normal equations are:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 + 𝑐∑𝑥 2
∑𝑥𝑦 = 𝑎∑𝑥 + 𝑏∑𝑥 2 + 𝑐∑𝑥 3
∑𝑥 2 𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 3 + 𝑐∑𝑥 4
Here 𝑛 = 5
𝒙 𝒚 𝒙𝟐 𝒙𝟑 𝒙𝟒 𝒙𝒚 𝒙𝟐 𝒚
1 6 1 1 1 6 6
2 11 4 8 16 22 44
3 18 9 27 81 54 162
4 27 16 64 256 108 432
∑𝒙 = 𝟏𝟎 ∑𝒚 = 𝟔𝟐 ∑𝒙𝟐 = 𝟑𝟎 ∑𝒙𝟑 ∑𝒙𝟒 ∑𝒙𝒚 ∑𝒙𝟐 𝒚
= 𝟏𝟎𝟎 = 𝟑𝟓𝟒 = 𝟏𝟗𝟎 = 𝟔𝟒𝟒
Substituting these values in the normal equations:
62 = 4𝑎 + 10𝑏 + 30𝑐 … … … (1)
190 = 10𝑎 + 30𝑏 + 100𝑐 … … … (2)
644 = 30𝑎 + 100𝑏 + 354𝑐 … … … (3)
Solving these equations,
(1) × 3 ⟹ 186 = 12 𝑎 + 30𝑏 + 90𝑐
(2) × 1 ⟹ 190 = 10𝑎 + 30𝑏 + 100𝑐
− − − −
−4 = 2𝑎 − 10𝑐
∴ −2 = 𝑎 − 5𝑐 ……..(4)
(2) × 10 ⟹ 1900 = 100𝑎 + 300𝑏 + 1000𝑐
(3) × 3 ⟹ 1932 = 90𝑎 + 300𝑏 + 1062𝑐
− − − −
−32 = 10𝑎 − 62𝑐
∴ −3.2 = 𝑎 − 6.2𝑐……..(5)
(4) − (5) ⟹ −2 = 𝑎 − 5𝑐
⟹ −3.2 = 𝑎 − 6.2𝑐
+ − +
1.2 = 1.2𝑐 ……..(5)
∴𝑐=1 put in (4)
➢ 𝑎 = −2 + 5𝑐
𝑎 = −2 + 5(1)
𝑎 = 3 𝑝𝑢𝑡 𝑖𝑛 (1),
➢ 10𝑏 = 62 − 4𝑎 − 30𝑐
= 62 − 4(3) − 30(1)
10𝑏 = 20
𝑏=2
we get, 𝑎 = 3, 𝑏 = 2, 𝑐 = 1
Therefore, the required curve is: 𝒚 = 𝟑 + 2𝒙 + 𝒙𝟐
Example – 3
Fit the second-degree parabola 𝑦 = 𝑎 + 𝑏𝑥 2 to the following data:
𝑥 1 2 3 4 5
𝑦 1.8 5.1 8.9 14.1 19.8
Solution:
Let 𝑦 = 𝑎 + 𝑏𝑥 2 be the best fit curve to the given data.
Then normal equations are:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 2
∑𝑥 2 𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 4
Here 𝑛 = 5
𝒙 𝒚 𝒙𝟐 𝒙𝟒 𝒙𝟐 𝒚
1 1.8 1 1 1.8
2 5.1 4 16 20.4
3 8.9 9 81 80.1
4 14.1 16 256 225.6
5 19.8 25 625 495
∑𝒙 = 𝟏𝟓 ∑𝒚 = 𝟒𝟗. 𝟕 ∑𝒙𝟐 = 𝟓𝟓 ∑𝒙𝟒 = 𝟗𝟕𝟗 ∑𝒙𝟐 𝒚 = 𝟖𝟐𝟐. 𝟗
Substituting these values in the normal equations:
49.7 = 5𝑎 + 55𝑏 ……(1)
822.9 = 55𝑎 + 979𝑏 ……(2)
Divide Eq (2) with constant 11,
49.7 = 5𝑎 + 55𝑏
74.8091 = 5𝑎 + 89𝑏
− − −
−25.1091 = −34 𝑏
∴ 𝒃 = 𝟎. 𝟕𝟑𝟖𝟓 put in Eq (1),
∴ 5𝑎 = 49.7 − 55𝑏
= 49.7 − 55(0.7385)
= 9.0825
∴ 𝒂 = 𝟏. 𝟖𝟏𝟔𝟓
we get, 𝑎 = 1.8165 & 𝑏 = 0.7385
Then the required curve is: 𝒚 = 𝟏. 𝟖𝟏𝟔𝟓 + 𝟎. 𝟕𝟑𝟖𝟓 𝒙𝟐
❖ Exercises
1. Fit a second-degree polynomial using the least square method to the following data:
𝑥 1 2 3 4
𝑦 1.7 1.8 2.3 3.2
Also Estimate 𝑦(2.4)
Ans: 𝑦 = 2 − 0.5𝑥 + 0.2𝑥 2 & 𝑦(2.4) = 1.952
2. Fit a curve 𝑦 = 𝑎𝑥 + 𝑏𝑥 2 to the following data:
𝑥 1 2 3 4 5 6
𝑦 2.51 5.82 9.93 14.84 20.55 27.06
Ans: 𝑦 = 2.11 + 0.4𝑥 2
❖ Fitting of Exponential and Logarithmic Curve
➢ For the curve 𝑦 = 𝑎𝑏 𝑥 ,
Take logarithm on both sides,
log 𝑦 = log 𝑎 + 𝑥 log 𝑏
Now put log 𝑦 = 𝑌, log 𝑎 = 𝐴, 𝑥 = 𝑋 𝑎𝑛𝑑 log 𝑏 = 𝐵, then equation becomes,
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
The other curves 𝑦 = 𝑎𝑥 𝑏 and 𝑦 = 𝑎𝑒 𝑏𝑥 can be obtained by the same method.
➢ For the curve 𝑦 = 𝑎𝑒 𝑏𝑥 ,
Take logarithm on both sides,
log 𝑦 = log 𝑎 + 𝑏𝑥 log 𝑒
Now put log 𝑦 = 𝑌, log 𝑎 = 𝐴, 𝑥 = 𝑋 𝑎𝑛𝑑 𝑏 = 𝐵, then equation becomes,
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
➢ For the curve 𝑦 = 𝑎𝑥 𝑏 ,
Take logarithm on both sides,
log 𝑦 = log 𝑎 + 𝑏 log 𝑥
Now put log 𝑦 = 𝑌, log 𝑎 = 𝐴, 𝑙𝑜𝑔𝑥 = 𝑋 𝑎𝑛𝑑 𝑏 = 𝐵, then equation becomes,
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
Example – 1
Fit a curve 𝑦 = 𝑎𝑏 𝑥 from the given data:
𝑥 1 2 3 4 5 6 7
𝑦 87 97 113 129 202 195 193
Solution:
Here, the given curve is, 𝑦 = 𝑎𝑏 𝑥
Take logarithm on both sides, log 𝑦 = log 𝑎 + 𝑥 log 𝑏
Now put log 𝑦 = 𝑌, log 𝑎 = 𝐴, 𝑥 = 𝑋 𝑎𝑛𝑑 log 𝑏 = 𝐵, then equation becomes,
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
Here 𝑛 = 7
𝒙 𝒚 𝑿 𝒀 𝑿𝟐 𝑿𝒀
1 87 1 4.4659 1 4.4659
2 97 2 4.5747 4 9.1494
3 113 3 4.7274 9 14.1822
4 129 4 4.8598 16 19.4392
5 202 5 5.3083 25 26.5415
6 195 6 5.2730 36 31.6380
7 193 7 5.2627 49 36.8389
∑𝑿 = 𝟐𝟖 ∑𝒀 ∑𝑿𝟐 = 𝟏𝟒𝟎 ∑𝑿𝒀
= 𝟑𝟒. 𝟒𝟕𝟏𝟖 = 𝟏𝟒𝟐. 𝟐𝟓𝟓𝟏
Substituting these values in the normal equations:
34.4718 = 7𝐴 + 28𝐵 ……(1)
142.2551 = 28𝐴 + 140𝐵 ……(2)
Divide Eq (2) with constant 4,
34.4718 = 7𝐴 + 28𝐵
35.5638 = 7𝐴 + 35𝐵
− − −
−1.092 = −7𝐵
∴ 𝑩 = 𝟎. 𝟏𝟓𝟔 put in Eq (1),
1
∴𝐴= (34.4718 − 28𝐵)
7
1
= (30.1038)
7
∴ 𝑨 = 𝟒. 𝟑𝟎𝟎𝟓
A = log 𝑒 𝑎 ⇒ 𝑎 = 𝑒 4.3005 = 73.7367
B = log 𝑒 𝑏 ⇒ 𝑏 = 𝑒 0.156 = 1.1688
we get, 𝑎 = 73.7367 & 𝑏 = 1.1688
Then the required curve is: 𝒚 = 𝟕𝟑. 𝟕𝟑𝟔𝟕(𝟏. 𝟏𝟔𝟖𝟖)𝒙
Example – 2
Using a method of least square fit the curve of the form 𝑦 = 𝑎𝑒 𝑏𝑥 to the following data:
𝑥 0 2 4
𝑦 5.012 10 31.62
Solution:
Here, the given curve is , 𝑦 = 𝑎𝑒 𝑏𝑥
Take logarithm on both sides, log 𝑦 = log 𝑎 + 𝑏𝑥 log 𝑒
Now put log 𝑦 = 𝑌, log 𝑎 = 𝐴, 𝑥 = 𝑋 𝑎𝑛𝑑 𝑏 = 𝐵, then equation becomes,
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
Here 𝑛 = 3,
𝒙 𝒚 𝑿=𝒙 𝒀 = 𝐥𝐨𝐠 𝒆 𝒚 𝑿𝟐 𝑿𝒀
0 5.012 0 1.6118 0 0
2 10 2 2.3026 4 4.6252
4 31.62 4 3.4538 16 13.8152
∑𝑿 = 𝟔 ∑𝒀 𝟐 ∑𝑿𝒀
∑𝑿 = 𝟐𝟎
= 𝟕. 𝟑𝟔𝟖𝟐 = 𝟏𝟖. 𝟒𝟐𝟎𝟒
Substituting these values in the normal equations:
7.3682 = 3𝐴 + 6𝐵 ……(1)
18.4204 = 6𝐴 + 20𝐵……(2)
Divide Eq (2) with constant 2,
7.3682 = 3𝐴 + 6𝐵
9.2102 = 3𝐴 + 10𝐵
− − −
−1.8420 = −4𝐵
∴ 𝑩 = 𝒃 = 𝟎. 𝟒𝟔𝟎𝟓 put in Eq (1),
1
∴𝐴= (7.3682 − 6𝐵)
3
∴ 𝑨 = 𝟏. 𝟓𝟑𝟓𝟏
A = log 𝑒 𝑎 ⇒ 𝑎 = 𝑒 1.5351 = 4.6418
we get, 𝑎 = 4.6418 & 𝑏 = 0.4605
Then the required curve is: 𝒚 = 𝟒. 𝟔𝟒𝟏𝟖𝒆(𝟎.𝟒𝟔𝟎𝟓 )𝒙
Example – 3
Fit a curve 𝑦 = 𝑎𝑥 𝑏 from the given data:
𝑥 61 26 7 2.6
𝑦 350 400 500 600
Solution:
Here, the given curve is , 𝑦 = 𝑎𝑥 𝑏
Take logarithm on both sides, log 𝑦 = log 𝑎 + 𝑏 log 𝑥
Now put log 𝑦 = 𝑌, log 𝑎 = 𝐴, 𝑋 = log 𝑒 𝑥 𝑎𝑛𝑑 𝑏 = 𝐵, then equation becomes,
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
Here 𝑛 = 4,
𝒙 𝒚 𝑿 = 𝐥𝐨𝐠𝒆 𝒙 𝒀 = 𝐥𝐨𝐠 𝒆 𝒚 𝑿𝟐 𝑿𝒀
61 350 4.1109 53.8579 16.8995 24.0814
26 400 3.2581 5.9915 10.6152 19.5208
7 500
500 1.9459 6.2146 3.7866 12.0931
2.6 600 0.9555 6.3969 0.9130 6.1123
∑𝑿 = 𝟐𝟖 ∑𝒀 𝟐 ∑𝑿𝒀
∑𝑿
= 𝟐𝟒. 𝟒𝟔𝟎𝟗 = 𝟑𝟐. 𝟐𝟏𝟒𝟑 = 𝟔𝟏. 𝟖𝟎𝟕𝟔
Substituting these values in the normal equations:
24.4609 = 4𝐴 + 10.2704𝐵 ……(1)
61.8076 = 10.2704𝐴 + 32.2143𝐵 ……(2)
Divide Eq (1) with constant 4 & Divide Eq (2) with constant 10.2704
6.1152 = 𝐴 + 2.5676𝐵
6.0180 = 𝐴 + 3.1366𝐵
− − −
0.0972 = −0.5690𝐵
∴ 𝑩 = 𝒃 = −𝟎. 𝟏𝟕𝟎𝟖 put in Eq (1),
1
∴𝐴= (24.4609 − 10.2704𝐵)
4
∴ 𝑨 = 𝟔. 𝟓𝟓𝟑𝟖
A = log 𝑒 𝑎 ⇒ 𝑎 = 𝑒 6.5538 = 701.9064
we get, 𝑎 = 701.9064 & 𝑏 = −0.1708
Then the required curve is: 𝒚 = 𝟕𝟎𝟏. 𝟗𝟎𝟔𝟒𝒙(−𝟎.𝟏𝟕𝟎𝟖)
❖ Exercises
1. Find the law of the form 𝑦 = 𝑎𝑏 𝑥 to the following data:
𝑥 1 2 3 4 5 6 7 8
𝑦 1 1.2 1.8 2.5 3.6 4.7 6.6 9.1
Ans: 𝑦 = 0.6823(1.3828)𝑥
2. Fit the curve 𝑦 = 𝑎𝑥 𝑏 to the following data:
𝑥 1 2 3 4
𝑦 2.50 8.00 19.00 50.00
Ans: 𝑦 = 2.227𝑥 2.09