Professional Documents
Culture Documents
Curve fitting-I-II
Curve fitting-I-II
CURVE-FITTING
numerical values (z Y
and which give us a e t ofn pairsof
variables x y these
let there be two idea about the relationship of two
The constants
methods: ii) Method of group averages
(i) Graphical method
(iv) Method of moments.
(iii) Method of least squares discus8 and study here method oflenat
.
four methods, we will only
Out of the above
squares.
LEAST SQUARES
8.12. METHOD OF
set of values to the constants and hence suggests a
data.
curve of best fit to the given
of two variables :
have m-paired observations (x, J1), t2, Y2),. , m Ym
Suppose we
of degree n of the type
and y. It is required to fit a polynomial
+ kx"
.1
y = a + bx + cx* +..
constants a, b, c, k such that it represents the
of these values. We have to determine the
..,
y a + b r t CXt + kx
where J2, y are the expected values ofy for x =x, 2 x respectively. The v
y uY , Ym are called observed values ofy corresponding tox = xq, I2, . . respecu
differ
The expected are values
ent values of r are called residuals.
different from observed values, the difference y, -y, for
Introduce a new quantity U such that
U= y, -y,* Zy, - a bx, - cx2-.kx,"¥
= -
of
The constants a, b, C, , k are chosen in such a way that the sun of the squares
residuals is minimum.
FITTING
405
CURVE
pA4TAAND
OU OU
for U to be maximum or minimum is =0 =-OU_U
Now 1aw the condition Oc
these relations, we get
simplifying
On Ey = ma + b2x + .. +kx
-a-bx)
i=1
minimum
By the principle of Least squares, U is
and =0
ob
da
or 2y = na + 62x ..(2)
2 - a -bx;X-1) =0
x -
(mean of two middle terms)
but if n is even then u =
interval)
2
COMPUTER BASED NUMERIC AND
STATISTICAL
408 TECHNIQUES
EXAMPLES
2 3 4
0 1
3.3 4.5 6.3.
1 1.8
y:
obtained from the given data be y =a + bx then d
Sol. Let the straight line
equations are
y =ma +b Ex 1)
aZr + b2x2 2)
Zaxy =
m = 5
Here
0
0 1
1.8 1.8
1
6.6 4
2 3.3
4.5 13.5 9
3
25.2 16
6.3
10b
From (1) and (2), 16.9 =5a +
1200 1200
2 900 4 1800
3 600 9 1800
200 16 800
5 110 25 550
50 36 300
x 21 y 3060
=91 . Eaxy 6450
TING
AND C U R V E F I T T I N G 409
DATA
equations,
we get
normal
From 3060 6a +21b, 6450 = 21a + 91b
a = 1361.97, b = - 243.42
Solving, we get
Requiredline is
y 1361.97 -243.42 x.
to the follouwing data isgiven by y 0.7x+ 11.285
Example 3. Show that the line offit
=
0 5 10 15 20 25
15 17 22 24 30.
12
- 5 -8 40 25
0 12
15 9
15 3 -5
5
-3
10 17
2 1
2
15 22
12 9
3 4
20 24
50 25
5 10
25 30
uv = 122 Eu= 70
Eu = 0 Zv = 0
Total
and 122 = 70b
Normal equations are 0 = 6a
1.743
a =
0, b=
U 1.743u
Line of fit is
and v
2.5
11.285.
y 0.7x +
data:
line to the following
straight 67
Example 4. Fit a 67 65 66
73 69
71 68 67 68 64.
70 68
72 70
69 line to be fitted
be
of the straight
equation ..1)
Sol. Let the
=a + bx
y
Normal equations are ..(2)
ma + 62x
y =
.(3)
a x + b2x2
Eaxy =
and
COMPUTER BASED ERICAL AND
410
STATISTICAL TECHHNIQUES
below:
Here m = 8. Table is as
69 4899 5041
71
72 4896 4624
68
70 5110 5329
73
70 4830 4761
69
68 4556 4489
67
67 4355 4225
65
66 68 4488 4356
64 4288 4489
67
y 39.5454 +0.4242 x.
Example 5. Show that the best fitting linear function for the points (xp Yy, lx Yy.
( Yn) may be expressed in the form
1
i n = 0 i = 1, 2, . )
Show that the line passes through the mean point (+, J).
Sol. Let the best fitting linear function be y = a + bx ..(1)
62x y, +
-
na = 0
and bE-ay; + a = 0
FITTING
ATA
AND
CURVE
411
and b between these equations
Eliminating a
1
= 0 4)
hich is the required best fitting linear function for the mean point , ) ,
F n -
Clearly, the line (4) passes through point (z, J) as two rows of determinant being equal make
I zero.
ASSIGNMENT
8.28. POLYNOMIAL FIT: NON-LINEAR REGRESSION
Let y a + bx + cx2
=
be a second degree parabolic curve of regression of y onx to be fitted for the data
1)
i= 1, 2, .
Residual at x =
*;is
E -Aa) =y, -
a -
bx, cx2-
aU
da
0 22
i=1
, -
a -
aU
= 0
2 ,-a bx; -
-cx)-z) = 0
F
CAVE
AN"
Xry = ar +b2r2 + c
NA
.(2)
o=0 2 -a -
bx, -cx)-)=0
ry= aXr +b2r3+ cX .3)
Carations (1),
Equations (1), (2):
(2) and (3) are the normal equations for fitting a second degree parabolic
tmession of y on x. Here n is the no. of pairs of values of * and y.
Cuneotr
EXAMPLES
*'y
1 6
6 16 22 44
8
2 11 81 54 162
9 27
3 18 256 108 432
16
64
4 27
354 xy 190 a y 644
30 Er3= 100
r = 10 y = 62 r=
(2), (3) and (4), ge
we
values in eqns.
Substituting ..6)
62 4a+ 10b +30c
100c ...6)
190 10a + 30b +
100b + 354c .(7)
644 30a +
3, b 2, c = 1
(6) and (7), we get a = =
10 12 15 23 20
Y. 14 17 23 25 21
Sol. The normal equations to the curve are
Substituting the obtained values from the table in normal equation (1), we have
CUPRVE
AND
ATA
E x a m p l e
aFit
3. Fit a parabolic curve
a parabolic.curve of regression
of y on x to the
following data:
1.5 2.0 2.5 3.0 3.5
1.0 4.0
1.3 1.6 2.0 2.7 3.4
1.1 4.1
m=7(odd)
Sol. Here
Let
u
x-2.-2x
2.5
0.5
-
5 and v
=y
tabular form are
Results in
u
u u
- 3 1.1
1.0 1.1 9 - 3.3
9.9 - 27
81
1.3 -2 1.3
1.5 2.6 5.2 16
2.0 1.6 1 1.6 - 1.6
1.6
2.5 2.0 0 2.0 0 0 0 0 0
3.0 2.7 2.7 1 2.7 2.7 1
3.5 3.4 2 3.4 6.8 13.6 8 16
4.0 4.1 3 4.1 9 12.3 36.9 27 81
Total 16.2 28 14.3 69.9 0 196
Let the curve to be fitted beU =a + bu cu2 that the normal
+ so
equations are
LU = 7a + b2u + cLu2
Zuv = au + bZu2 + cEu3
and Zuv = au2 + bZu3 + cZu4
16.2 = Ta + 28c, 14.3 = 28b, 69.9 = 28a + 196c
Solving, we get a 2.07, b= 0.511, c = 0.061
Hence the curve of fit is
U =2.07+0.511u +0.061u2
y = 2.07+ 0.511 (2x-5) +0.061 (2x -5 = 1.04-0.193ax + 0.2432
Example 4. Fit a second degree parabola to the following data by Least squares method:
1 2 3 4 5
u u u u4
- 130 4 - 520 260
1090 -2 -8 16
1 0 -1
1220
170 0 0 0 0
3 1390
1 405 405 405 1 1
1625
1915 2 695 2780 1390 8 16
5
Eu = 0 Ev = 1140u= 10| u v = 2665 Euv = 2055 Zu=0 2ut = 34
Total
432 COMPUTER BASED NUMERICAL AND STATISTICAL
TECHNIQUES
Putting these values in normal equations, we get
1140 5a'+ 10c, 2055 = 106, 2655 10a' +34c
a'= 173, b= 205.5, c' 27.5
1220