Professional Documents
Culture Documents
STATISTICS
CURVE FITTING
CURVE FITTING
Curve Fitting
The process of finding the equation of the curve which best fits the given values and most
suitable for predicting the unknown values is known as Curve Fitting.
The method which we use here for finding curve fitting is the method of least square.
There wish to describe a certain type of function that best expresses association that exists
between variables. Scatter plot of the set of values of the variables make it possible to visualize a
smooth curve that effectively approximates the given data set.
A more useful way to represent this sort of approximating curve is by means of an equation or a
formula. The terms applied to the process of determining the equation and/or estimating the
parameters appearing in the equation of approximating curve, is commonly called Curve Fitting.
LEAST SQUARE METHOD
Least Square Method
Following are the different method of Least Square:
1. Equation of Line
(𝑦 = 𝑎𝑥 + 𝑏 or 𝑦 = 𝑎 + 𝑏𝑥)
3. Exponential Curve
(𝑦 = 𝑎𝑋 𝑏 , 𝑦 = 𝑎𝑏 𝑥 or 𝑦 = 𝑎𝑒 𝑏𝑥 )
EQUATION OF LINE
1. Equation of Line
Line to be fitted for the data y = a + bx where a and b need to be calculated. We have the normal
equation for the least square straight line is:
𝑥 1 2 3 4 5
𝑦𝑖 3 4 6 9 10
EQUATION OF LINE
Solution:
Let the equation of the straight line to be fitted to the data, be y = a + bx where a and b are to be
evaluated.
The normal equations for determining a and b are;
2
𝑦 = 𝑛𝑎 + 𝑏 𝑥 and 𝑥𝑦 = 𝑎 𝑥 + 𝑏 𝑥
𝑥 𝑦 𝑥2 𝑦2 𝑥𝑦
Normal equations becomes;
1 3 1 9 3
2 4 4 16 8
5a + 15b = 32
3 6 9 36 18 15a + 55b = 115
4 9 16 81 36 Solving these equations: a = 0.7, b = 1.9
5 10 25 100 50
Hence the equation of the required straight line is;
15 32 55 242 115
𝒚 = 𝟎. 𝟕 + 𝟏. 𝟗𝒙
EQUATION OF LINE
For finding error
𝒚 = 𝟎. 𝟕 + 𝟏. 𝟗𝒙 𝒆𝒊 = 𝒚𝒊 − 𝒚
𝟎. 𝟕 + 𝟏. 𝟗 𝟏 = 𝟐. 𝟔 3 − 2.6 = 0.4
𝟎. 𝟕 + 𝟏. 𝟗 𝟐 = 𝟒. 𝟓 4 − 4.5 = −0.5
𝟎. 𝟕 + 𝟏. 𝟗 𝟑 = 𝟔. 𝟒 6 − 6.4 = −0.4
𝟎. 𝟕 + 𝟏. 𝟗 𝟒 = 𝟖. 𝟑 9 − 8.3 = 0.7
𝟎. 𝟕 + 𝟏. 𝟗 𝟓 = 𝟏𝟎. 𝟐 10 − 10.2 = −0.2
𝑒𝑖 =0
FITTING A SECOND DEGREE PARABOLA
2. Fitting A Second Degree Parabola
The simplest type of a non-linear approximating curve is the second degree parabola that
has the equation.
𝑦 = 𝑎 + 𝑏𝑥 + 𝑐𝑥 2
Where the values of a, b and c to be determined by;
2 3
𝑦 = 𝑛𝑎 + 𝑏 𝑥 + 𝑐 𝑥 2 , 𝑥𝑦 = 𝑎 𝑥 + 𝑏 𝑥 + 𝑐 𝑥 and
3 4
𝑥 2𝑦 = 𝑎 𝑥2 + 𝑏 𝑥 +𝑐 𝑥
Solution:
Let the equation of the second degree parabola be;
𝑦 = 𝑎 + 𝑏𝑥 + 𝑐𝑥 2
Example:
Find the equation of the curve 𝑦 = 𝑎𝑏 𝑥 that best fits the following data and find y(10).
𝑥 3 4 5 6 7 8 9
𝑦 11 12 14 18 19 21 23
Solution:
Since 𝑦 = 𝑎𝑏 𝑥
Therefore 𝑙𝑛𝑦 = 𝑙𝑛𝑎 + 𝑥𝑙𝑛𝑏
Let 𝑙𝑛𝑦 = 𝑌, 𝑙𝑛𝑎 = 𝐴 and 𝑙𝑛𝑏 = 𝐵
Now 𝑌 = 𝐴 + 𝐵𝑥
2
Which is now in linear form: 𝑌 = 𝑛𝐴 + 𝐵 𝑥 and 𝑥𝑌 = 𝐴 𝑥+𝐵 𝑥
EXPONENTIAL CURVE
𝑥 𝑦 𝑌 = 𝑙𝑛𝑦 𝑥𝑌 𝑥2 7A + 42B = 19.5
3 11 2.39 7.17 9 42A + 280B = 120.65
4 12 2.48 9.92 16 B = 0.130, A = 2.003
5 14 2.63 13.5 25
6 18 2.89 17.34 36
7 19 2.94 20.58 49 Now,
8 21 3.04 24.32 64
9 23 3.13 28.17 81
𝐴 = 𝑙𝑛 𝑎 𝐵 = 𝑙𝑛 𝑏
𝑒𝐴 = 𝑎 𝑒𝐵 = 𝑏
42 118 19.5 120.65 280
𝑒 2.003 = 𝑎 𝑒 0.130 = 𝑏
a = 7.411 b = 1.138
𝒚 = 7.47446(1.138)𝑥 = 7.411(1.138)10
𝒚 = 𝟐𝟔. 𝟗𝟗
EXPONENTIAL CURVE
Example:
Determine the constant a and b by the method of least square such that 𝑦 = 𝑎𝑒 𝑏𝑥 to the
following data:
𝑥 2 4 6 8 10
Solution:
The given relation is: 𝑦 = 𝑎𝑒 𝑏𝑥
Therefore 𝑙𝑛𝑦 = 𝑙𝑛𝑎 + 𝑏𝑥
Let 𝑙𝑛𝑦 = 𝑌 and 𝑙𝑛𝑎 = 𝐴
Now 𝑌 = 𝐴 + 𝑏𝑥
2
Which is now in linear form: 𝑌 = 𝑛𝐴 + 𝑏 𝑥 and 𝑥𝑌 = 𝐴 𝑥+𝑏 𝑥
EXPONENTIAL CURVE
𝑥 𝑦 𝑌 = 𝑙𝑛𝑦 𝑥𝑌 𝑥2 17.023 = 5A + 30b
2 4.077 1.405 2.810 4 122.146 = 30A + 220b
4 11.084 2.405 9.620 16 A = 0.403, b = 0.5
6 30.128 3.405 20.430 36
8 81.897 4.405 35.240 64
10 222.62 5.405 54.050 100 Now,
30 349.806 17.023 122.146 220 𝐴 = 𝑙𝑛 𝑎 𝑏 = 0.5
𝑒𝐴 = 𝑎
𝑒 0.403 = 𝑎
a = 1.496 b = 0.5
Now
𝒚 = 𝟏. 𝟒𝟗𝟔𝒆𝟎.𝟓𝒙
EXPONENTIAL CURVES
Example:
Fit an equation of the form 𝑌 = 𝑎𝑋 𝑏 to the following data:
𝑋 1 2 3 4 5 6
Solution:
We may reduce the given equation to a linear form by taking logs to the base 10. Thus
𝑙𝑛 𝑌 = 𝑙𝑛 𝑎 + 𝑏 𝑙𝑛 𝑋
Or 𝑌 ′ = 𝐴 + 𝑏𝑋 ′
Where 𝑌 ′ = 𝑙𝑛 𝑌, 𝐴 = 𝑙𝑛 𝑎 and 𝑋 ′ = 𝑙𝑛 𝑋
As the equation is linear in 𝑌 ′ = 𝑙𝑛 𝑌 and 𝑋 ′ = 𝑙𝑛 𝑋, therefore the two normal equations are;
EXPONENTIAL CURVES
𝑌 ′ = 𝑛𝐴 + 𝑏 𝑋′
2
𝑋 ′𝑌′ = 𝐴 𝑋′ + 𝑏 𝑋′