0% found this document useful (0 votes)
395 views25 pages

Ch. 9 Curve Fitting

This document discusses curve fitting and the principle of least squares. It explains that the principle of least squares aims to determine the curve of best fit by minimizing the sum of the squares of the deviations between actual data points and estimated data points from the curve. Specifically for fitting a straight line, it derives the normal equations to estimate the parameters a and b of the line y=a+bx by minimizing this sum of squared deviations. It provides the working rule and an illustrative example of using the normal equations to fit a straight line to a set of data points.

Uploaded by

NINJA 0.0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
395 views25 pages

Ch. 9 Curve Fitting

This document discusses curve fitting and the principle of least squares. It explains that the principle of least squares aims to determine the curve of best fit by minimizing the sum of the squares of the deviations between actual data points and estimated data points from the curve. Specifically for fitting a straight line, it derives the normal equations to estimate the parameters a and b of the line y=a+bx by minimizing this sum of squared deviations. It provides the working rule and an illustrative example of using the normal equations to fit a straight line to a set of data points.

Uploaded by

NINJA 0.0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

9

CURVE FITTING AND PRINCIPLE OF


LEAST SQUARES
To express the data involving two variables we need to establish some relationship between them. To
express their relationship there must be some rule by which they can be related to each other. To overcome
this problem we take one of them as the independent function, while the other as dependent function.
Independent functions are generally represented by x where as the dependent functions are represented by y.
The law which connects the two variables is known as Empirical law. We take the related values in pairs
and express h e m as ( , ) where i = 1,2, 3, . . These pairs o f values are plotted on the graph paper on

some suitable scale taking the values of x along r-axis and those ofy along y-axis. The clustering of these
points on the graph-paper is known as the Scatter diagram. A smooth curve is drawn through these points
in such a way that the plotted points remain closer to the curve as for as possible. Such a curve is know as
an approximation Curve. The mathematical equation of this curve connecting the various values of x and
y is known as the Empirical Equation.
The process of getting the curve based upon the equations thus obtained is Curve Fitting. The
constants involved while establishing the empirical relation between the variables are determined with the
help of well established mathematical techniques and theories. Some of the methods of curve fitting are as
under
() Graphic Method
i) Grouping of averages
(iin) Least square method
() Method of moments
We will do problems by least square method.

9.1. The Method of Least Squares


Let (x, y).(x,, V,),... ( , V,) be given set of values of independent and dependent

variables x, and y, respectively and we are required to fit a curve of type to

.()
y =a + bx + cx*+..... +kx"=f(r)
CSe values. Now, we have to determine constants a, b, c . . . . . . k such that it represents the curve of best fit
of that degree.
between 's, the
to the function. The error (or deviation)
Let
f x) be an approximation
shown in figure are either positive, zero or negative.
OXimation and y the actual tabulated values are as

281
SPECTRUM ENGINEERING MATHEM.
282 MATICSI
yS()

dn

i.e.

d2- 2-f(r,)

',Y,-S(7,)
The least square method states that "A curve is a best fit i.e. the curve of best fit if the sum ofsquares
of deviation between the actual vaBues of dependent variable (y,) and estimated values of dependen
"

F,) is minimum.
i.e. d+d+d +..d minimum

ie. S- 24- Z0,-5-20,-SG)¥isminimum


ie. S=
(o,-a-bx,-cx x,"
The that
principle of least squares asserts that the constants a, b, C, ..... k are chosen in such a way so
the sum of squares of the deviations (residuals or errors) is minimum.
A curve having this property is said to fit the data in the least square uare
sense and is called least su
curve.

9.2. Fitting of a Straight Line


Let us consider the
fitting of a straight line
Y =a+ bX
to a set ofn points (x, y,) ; i =1, 2..... n. Equation (1) represents a family of straigntlines
different values of a and b, so that line (1) is a line of best fit.
FITTINGAND PRIN
INCIPLE OF LEAST SQUARES
CURV 283
The term 'best fit is
interpreted in accordance
with the
of least squares which consists in
principle

of the deviations of minimising the sum


the actual values y=a*bX
o fthe s q u a r e s
f the ilues as given by theiline of best fit.
y from its
PxY)
estimated

Let P(x,, y,) be any


general point in plane and draw
DM 1 to x-axis so as tO meet the given line in H (x,, a +bx,).
H,a + h )

PH PM HM =

-(a + bx,), which


-

y, is called
or of estimate or the residual for y, and is denoted
error error
X
M
by e,i.e. e,Y,-(a +bx,)
According to the principle of least squares, we have to determine a and b so that

E -E4- -a-bx) is minimum.


From the principle of maxima and minima, the partial derivatives of E w.r.t a and b should vanish
separately i.e.

and
Oa

-220-a-bx,) =0
i=l
(2)
and -22, (y; -a-bx,) =0
i=l

y =na+bE2x ..(3)
and x y =a 2x+b 2x4

normal equations for estimating a and b.


Equations (2) and (3) are known as
All the quantities Ex, 2x',2y and E xy can be obtained from the given set of points (x, y,) ; i=
,2 n and the equation (3) can be solved for a and b. With these values of a and b, equation (1)

epresents the line of best fit to the given set of points (, y) ;i=1,2,. n.

Working Rule to Fit Linear Curve (y= ax+b)


uppose (x, y) be the given set of observations
Find Zx, 2x, E y, Zxy
Put these values in Normal equations ...(1)
2y =a 2x+nb ..2)
and x y = a 2x+b2rx

(ii) Solve (1) and (2), for a and b


ar + b, which will be the required equation of best fit.
(iv) u t these values of a and b in
P y=
SPECTRUM ENGINEERING MATH.
284
MAIRA
ILLUSTRATIVE EXAMPLES
line to the following data:
Example 1. Fit a straight
2 3 6 8

24 3 3-6 4 6

Sol. Let the line be y=a+bx

Normal equations are

y =
na +b 2x

xy= a Yx +b 2x

xy

2.4 2:4

2 3-1 6-0

36 10 8 9

4-0 16-0 16

5-0 30-0 36

8 6-0 48-0 64

2x 24 y 240 xy=113 2 x 130


24 6 a +b (24) a+4b =4
and 113.2 24 a +b (130) 1 2 a+ 65 b 56-6
a=1-976 and b =0.506

Therefore, from (1) we have,

y =1-976 +0 506 x is a line of best fit.

Example 2. Fit a linear curve to the data


(P.T.U. 205
{x,y): (1, 1), (2, 5), (3, 11), (4, 8), (5, 14)}
Sol. The given set of observations are

2 3 5
1 5 11 14
+b
Let the linear curve be y
=
ax
FITTING AND RINCIPLE OF LEAST
CRVE
SQUARES
It Normal equations are given by 285

2y =a x+nb
2xy (2)
and =a 2x +b2x
.(3)

2
10

33
8
32 16
5
14
70 25
x - 15 y 39 2xy = 146 2 55
Put values of 2x, 2 y, 2xy and 2r in
(2) and (3) we get
15a+5b 39
55a + 15b - 146
...(4)
5)
Multiply (4) by (3) and subtracting from (5), we get
29
a
10

29
Put a
10
in (4), we get b=. T09
Put values of 'a' and 'b' in (1), we get
29 9
10 10

or 29x 10v=9, which is required linear curve.


EXample 3. Fit a straight line to the following data considering y as the dependent variable

3 4 5
( 9 10
7 11

(P.T.U. 2014)
11 2 5 6-5

2 3 4

(P.T.U. 2015)
) Let the line be p= a +bx, where a and b are given by normal equations .(1)

2y=na +b2x
2
Zxy=a Er+b2x
286
SPECTRUM ENGINEERING MAT.
MATHEMAI
xy

7 14

9 27
10 40 16
55 25
141
xy 255
=

2x= 15 2y=42

Therefore, we have 42 5 a+b(15)


5 a + 15 b =42
and 141 =a (15) + b (55)

1 5 a +55 b = 141
Multiplying (2) by 3 and (3) by 1, we get

15a+45 b=126
15 a+5b= 141
Subtracting (4) and (5), we get

10b 15 b= =

Putting b 1:5 in (2)we get


Sa+22-5=42 5a= 19.5 a=3.9
a=3-9, b= 1:5
Therefore, from (1) we have
y=3.9+1 5x, is a line of best fit.
(ii) Let the line be yza+bx, where a and b are given by normal equations
2y=na+b2x
and Exy=a Ex+ b 2 x

1-1 0 0 1 21

2 4

2 9
3 15 25
6-5 4 26 42 25

r = 17.6 y= 10 2 8146
2xy= 49
NG
C U R V EF I T T I N G , AND PRINCIPLE OF LEAST SQUARES
Therefore, we have 287

10 5at b(17*6) 5 a + 17.6 b= 10


19 176 atb(81-46) >
17.6 a +81 46 b= 49 ..2)
Multiplying (2) by 17-6 and (3) by 5, we get .(3)
88 a+ 309 76 b= 176
88 a+ 407-3 b= 855.54 (4)

On subtracting (4) from (5), we get .(5)


97 54 b 679 54 b=6.967
From (2), we have

10 5a+(6-967) (17- 6) 5a=- 112-6192


a-22.524
a=-22 54, b=6:967
Therefore, from (1)
y=-22 524+(6.967) x is the line of best fit.
Example 4. Fit a linear curve to the data {(x, y):(1, 14), (2, 27), (3, 40), (4, 55), (5, 68)}.
(P.T.U. 2011)
Sol. Let the linear curve of best fit to the given set of data be
ysatbx
..(1)
where a and b are
given by normal equations
2y=na+bEx
and 2xy =aZr+b2

14 14 1

2 27 54 4

40 120 9

55 220 16
340 25
68

x 15 y 204 2xy=748 Xr-55

Therefore, we have
204 5 a+b (15) ..2)
Sa+ 15 b 204
and 748 a (15) + b (55) .(3)
1 5 a + 55 b 748
SPECTRUM ENGINE ERING MATHE
288

by 3 and (3) by 1, we get


Multiplying (2)
15 a t 45 b
=
612

15 a +55b= 748
Subtracting (4) and (5), we get
136
10b 136 b= =
13 6
10
from (4),
5 a+ 204 =204 5 a=0 a=0
a 0,b= 13.6
Therefore, from (1) we have

y 0+(13-6)x
ie. y= 13 6x is the line of best fit.
Example 5. Given below are the figures of production (in thousand tonnes) of coal:
Year 1979 1981 1982 1983 1984 1985 1986
Production 70 85 94 83 90 100 98
(in thousand tonnes)
(a) Fit a straight line by the method of least squares and calculate the trend values.
(6) What is the monthly increase in the production of coal ?
Sol.
Year Production Origin 1983
(in tones)
Xy Trend Values
()
()
1979 70 -4 16 280 76561
1981 85 2 A 82-359
170
1982 94 94 85-258
1983 83 0 0 88-157
00
1984 90 91056
90
1985 100 4 93-955
200
1988 98 25 490 102652
N7 2Y 6200 2X =
1 X=51
Let the
XY =
236
straight line trend is given by
ya+ bx
The normal
equations are
y=na +b 2x
and xy =aEx +b2x
CURVE FITTING AND PRINCIPLE OF LEAST SQUAREs
289
Substituting the values

620 7 a +b

236 a + 51b ..(2)


and
.(3)
1652 7a + 3576
subtracting (2) from (3), we get
1032 356 b
b 2:899
from (2). we get

620 7 a+2.899 a 88-157


Thus the straight line trend is
y =88-157+2.899x (Origin 1983, X unitOne year)
Calculation of Trend Values
For -4, V1979 88 157 + 2:899 (-4) 76:561
For 2. y 198188-157 +2:899(-2) =82-359
For *-1, y 198288-157 +2:899 (-1) 85-258
For x0, y 1983 88-157 +2899(0) 88 157
Forx1, 198488-157 +2-899 (1) =91-056
For 2, 198588 157 +2-899 (2) 93-955
For x= 5, y1988 88 157+2:899 (5) 102:652
(b) yearly production of coal = 2-899 thousand tonnes 2899 tonnes

Monthly production = 289 241 58 tonnes


12
Example 6. Calculate trend-values by the method ofleast squares from the data given below:
Year 1976 1977 1978 1979 1980 1981

Sales: 77 88 94 85 91 98

Plot the data showing the trend values.


Sol

YearSales (Y) Origin =1978-5


X=2x x XY Trend Values

5 25 385 81-33
1976 77 2:5
3 9 264 84 33
1977 88 - 1:5

-1 94 87-33
1978 94 -0:5
85 90-33
1979 85 0-5
9 273 93-33
1980 91 15
25 490 96-33
1981 98 2:5
2X 0 2X*= 70 2XY =105
2Y 533
SPECTRUM ENGINEERING MATHEMATIOSAL
Let the straight line trend be
Y =a+ b X
The nomal equations are

EY na+b 2X
and 2 XY=a 2X + b x?
Substitute the values
533 6 aa a 88-83
and 105 70 b b 15
the line of best fit is
Y =88-83+1:5X (Origin 1978 5, X unit =half ve=

Calculation of Trend Values


For X-5, Y1976 88:83 + (1-5) (-5)= 81-33
For X=-3, Y1977 88-83 +(1:5) (-3)- 8433
For X - 1, Y 1978 88 83 +(1-5) (-1)=87-33
Y197988-83 +(1-5) (1) = 90-33
For X=1,
For X-3, Y1980 88 83+(1-5) (3)
=
93-33
For X=5, Y198188-83 +(1-5) (5) =
9633

100
(98)
98
(96
33)

96
(94) (93-33)
94
ORIGINAL VALUES
92 (90-33)
90 91)
88 ,"(88)

86 (87 33)
84 (85)
(84 33)
82
(81 33)
80 TREND LINE AND TREND VALUES

78

76
(77)

xo
CIRVE ITTING AND PRINCIPLE OF LEAST SQUARES

291
Example7 Show that the best fitting linear function for the points (1. y). (x,, y3), . . F,: Yn)
in the form
be
expressed na

Ex Eyn0i1,2,.. n
2 xy Ex
Show that the line passes through the mean point (f, F)
Col. Let the line of best fit be y=a+ bx
where a and b are constants to be determined from the normal
equation:
y na+ b2x,
2)
and xy a2x +bX*
.(3)
The line of best fit is obtained by eliminating a and b from equations (1), (2) and (3), we get

ie. 2yn 0
|2xy Er 2r2|

i.e.
x n-0 i=1,2,...n

which is the required form.


Nowifthis line passes through ( . y), then

Er y n
n =
00

E2xy Sx
Now consider

yy
- ,, n
x xy 2x
2 xy x|
0
ience the line passes through (F, )
9.3. Fitting of Second Degree Parabola
.(1)
Let Y=a+ bX +cX principle of
V);i=1,2,....n. Using the
be the ses fit to the set of n points (»
econd degree parabola of best
b and c so that
a,
ast constants

squares, we have to termine


SPECTRUM ENGINE
2
EMATICS
The residue E =

-a-bx, -ex**
i=l

minimum
derivatives of E w.r.t. a, and c should
b andcs
var
From the principle of maxima: and minima, the partial
separately, i.e.

nd CE 0
Oc

Now - -220, -a-bx, - cx")=0


Oa

E y , = na+b2x, +cEx, 2

-2x, , -a-bx,-cx,")=0
Ob

a 2x, +bEx, +cEx;"


and -22x 0, -a -bx,-cx,")=0

x a Ex"+bEx +cZx,*
Equations (2), (3) and (4) are known as normal equations for estimating a, b and c.

and can be
All the quantities
i=l i =l i=l i=| i=l

obtained from the given set of points ( y,);i= 1,2,... n and using normal equations, we can find
values of a, b and c. For these values of a, b and c, equation (1) represent the best fit second deget
parabola to the given set of points (r,Y);i=1,2 . . . 7

Example 8. Fit a parabola of Ind degree to the following data

X: 2 3 4

Y: 18 1:3 2.5 6.3

Sol. Let y=atbx+ cx be the second degree parabola


iPLE OF
renormal equatidns for L.FAST SOU ARES
C U R V E F

The 293
na'
estimating the value of
.
hYr* eX a h and c ate

8
1
18 18
13 4
16 2-6 5.2
25 9
27 81 7:5 22 5
63 16
64 25 2 100 8
256
2y 12.9
30 -10o -354 Ery-37-1 Eyy=130-3
Using Normal equations, we have

5a 10 b+3 c= 12.9 ..(4)

10a+30 b+ 100 c = 37.1 ..(5)

30 a 100b+ 354 c= 130-3 ..(6)

On multiplying (4) by 2, we get


(7)
10a+20b +6c= 25 8
Onsubtracting (7) from (5), we get
(8)
10b+254e- 11:3
On multiplying (4) by 6, we get
(9)
77-4
30a +60 b+ 18 c #
On subtracting (9) from (6), we get
...(10)
40a+ 336 c =52.9
On multiplying (8) by 4, we get
..(11)
40 h+ 1016 c= 45 2
On subtracting (10) from (1 1), we get
...(12)
ie. c=-0-0l
060C 7 . 7 ,
294

On
SPECTRUMENGINEERING MATHEMAT
THEMATIKI
putting c- - 0 011 in (8), we get
106+ 254
(0011) - 11:3
10b 14.099 h- 1 4094
On
putting c=- 0-011 and b- 1 4094 in (4). we e
Sa+ 10 (1
4094)+3-0-011) - 12:9
Sa-1161a-0-2322
the from (1). required equation of parabola is

-0-2322 +
(1 4094)x-0-011x
Example 9. Fit a degree parabola to the following data
:
second
3-0 3-5 4-0
2.0 25
-0 15
2-0 2.7 34 41
.1 1-3 16
be tabulated as under
Ol.On shifting the origin to the point x =
2:5, the given data can

X x X* XY xY
-2:5x-2Y- 9 27 81 -3-3 9-9
-0 - 1.5 -3
- 8 16 -2-6 5-2
-5 - 1-0 2 1-3 4
- 1:6 1-6
2-0 -0-5 - 1 16
0 0-0 0-0
2.0 0
2.5 0-0 0
2-7 1 2-7 2:7
3-0 0-5
8 16 68 13-6
3-5 1-0 2 3.4 4

9 27 27 12-3 36-9
4-0 15 3 4.1
EX =0 EY =16-2 2X* =28 x ' =02X = 196 2XY= 14.3 2XY =69-9

Let the parabolic trend is given by


. (1)
Y=a+b X+cX*
The normal equations are

2Y 7a +b EX + cEX* 16-27a+ 28 c .(2)

EXY =aX+6EX* + c2X* 14-3 28b

XY aEx* +b2X'+c2X** 69.9 28 a + 196 c .(4

From (3), we have


143 b (28) b=.511

From (2) and (4)

7a+28 c==16-2 7a+ 28c- 16:2=0


and 28 a+ 196 c =69.9 7a + 49c-17.4750
NG AND
C U R V E F T T T I N GA N T

PRINCIPLE OF LEAST SQUARE


RES
Subtracting (6)from (5), we get
21 c-1-275 -0
C 0 0607
From (5), we get

7a+ 28 ( 0607) - 16-2-0


ired
»a=2-07 a - 2-07
parabolic trend is
Y
2-07+(0:511)X+ (0 0607) x=2-07+ (0-511)
-2-07+(0 511)[2r-5]+ (0-0607) (2x-5 2x') (0«060 +

=207+2 (0 511)x-2.555 (0
0607) (4x2 -20 x+25)
+

(2-07-2-555+ 1-5175) +x (1-022-1


=
1-0325 -0 192 214)+0-2428 *
(x)+ 2428
Ssample 10. Fit a parabola y= a+bx+cx* to the following data
2 4 10
6
y: 3.07 12-85 31-47 57-38 91-29
(P.T.U. 2012)

Sol On shifting the scale to the point X the given data can be tabulated as follows:

x2 x XY xY
Y=y

3 07 3-07
3-07
8 16 25 70 51-4
12-85
81 94-41 283 23
31 47 9 27
64 256 229-52 918-08
57-38 16
125 625 456-45 2282 25
10 91-29 25

EX-15Y= 195-71 2x-55 25 EX-9792XY 809 15X*Y -3538-75


Let the parabolic trend is given by
.(1)
Y=a+b X+ cX
The normal equations are
5a+ 15b+ 55 c= 195 71 ..(2)
2Y=5 a+ b2X+cEX
c2X * 15at55 b+225 c =809 15 ...3)
2XY =a2X+62x'+
55 a+255 b +979 c =3538-75 ..(4)
XY=a 2x+bEx*+cEX"
On
multiplying (2) by 3, we get
15 a+ 45 b+ 165 c = 587 13 ...(5)
On SPECTRUM ENGINEERIN
subtracting(5) from (3), we get MATIV.MA1
1 0 b +6 0 c =220 02

On multiplying (2) by 11, we get


55 a+ 165 b + 605 c =

2152 8I
On subtracting(7) from (4), we get
60 b +374 c 1385.94
On multiplying (6) by 6, we get
60 b+360c= 1320-12

On
subtracting(9) from (8), we get
14 c 65 82 c =4.7014
On putting c =4-7014 in (6), we get
10b +60(4-7014) =220-02
10 b=- 62
064
b=- 6 2064
On putting b =-
6 2064 and c=4.7014 in (2), we get
5a+ 15-6-2064)+ 55 (4 7014) =
195.71
5a-93-096 +258 577 195-71
5 a 30.229 or a =6.0458

from (1), the required parabolic trend is

Y 6-0458-6 2064 X +4.7014 X2

y=6 0458-6-2064(2x) +4.7014 (2x)


or
I XY-
i.e y=6 0458-12.4128 x +18 8056x
Example 11. Fit the curve y =a+bx to the data

X 10 20 30 40 50
8 10 15 21 30
Sol. Let curve of best fit be given by

y =a+br ..(1)
Normal equations are given by
2y =na +b2x .. .(2)
and 2xy = a Ex +b E r
...)
CURVEFITTING AND PRINCIPLE OF LEAST SQU ARES 291
Given data is

8 1000
10 80 100
10 8000
20 200 400
27000
30 15
450 900
64000
40 21 840 1600
125000

0 30 1500 2500 Er 225000

Er - 150 2y = 84
3070 Er-5500

Put these values of 2r, 2y, Zy, 2r, Xr' in (2) and (3), we get
.(4)

5a+ 5500 b =84 ..(5)


150 a+225000 b =3070
Multiply (4) by 30 and subtracting from (5), we get
11
b
1200
Put this value of "b' in (4), we get

69
a
10
from (1), required curve of best fit is given by
69 11
y- 10 1200
parabolic
from 1970 to 1976. Fit
a

12. Given below are India's Exports of engineering goods


Example
data.
trendY= a +bX+cX tothe 1972 1973 1974 1975 1976
1970 1971
Year 404 550
130 176 299
116-0 126-0
Exports Y (Rs. Cr.)
Forecast the exports for 1979.

Sol XY Trend
X X
Year Exports Origin Values
(Y) = 1973 (X)|
3 9 27 81 348 1044 19 82
1970 116
8 16 252 S04 112.51
4
1971 126
130 130 137 08
1972 130
0 0 193 53
0
1973 176
299 281 86
299
1974 299
1975 2
8 16 808 1616 402-07
404
1976 9 27 81 1650 4950 554-16
S50 3
N 7 2X =0 Ex' XY XY
2Y = 0 = 196
2027
= 8543
= 1801 28
29
SPECTRUM ENGINEERINGMATHEMaT
Let the
parabolic trend is represent by
Y =a bX+ cX
The normal
equations are
2Y na +h X+c X
XY N -AN x
and
xY -aYx 6yx' Xx'
Substituting the values we have
1801 7 a+ 28 c
2027 0+28 b +0 b = 72 39

and 8543 28 a+ 196 c

From I. 7204 28 a +112 c c = 15.94

Subtracting
84 c 1339

From I, 7a+28 (15.94) 1801 a 193 53


the parabolic trend becomes

Y = 193-53 +72:39 (X)+15-94 (X)


Origin 1973

XUnit= 1 Year

*Calculations of Trend Values


= 119 82
For X= -3, Y1970193-53 +72-39 (-3) 15.94 (-3)
For
X= -2, 0i Y 977 193 53 +72-39 (-2)
+15.94(-2) = 112-51

= 137-08
For X=-1 Y1972 193 53 + 72-39 (-1) +15.94 (-1)
For X- 0, Y1973= 193 53 + 7239 (0) +15.94(0) = 193 53

For X 1, Y1974193-53 +72 39 (1) +15-94(1) 281 86

For X2, Y1975 193 53 +72 39 (2) +15.94(2) 402-07

Y 1976 193 53 + 72 39 (3) = 554.165


For X 3, +15.94 (3)
To find the production for 1979 put X =6 (Origin is 1973 and X unit is one year)

T1979 193 53 +72 39 x 6+ 15.94 x 6


= 1201 7 1
CURVEFFT T I N G
GAND PRINCIPLE OF LEAST SQUARES 299

is the pull required to


EXERCISE 9 (a)
lift a load W
1
W+x connecting by means of a pulley block, find a inear an
P and W, using the following data
P-12 5
21 25
W 50
70 120
100
where P and W are taken in
kg-wt. Compute P when W 150 kg. wt.
Explain the method ot
least squares to fit a curve and use it to fit straight
lien y*u
data
1 5
2 3 4
14 68
27 40 55
(P.T.U. 2010)

In some determination of the volume v of carbon dioxide dissolved in a given volume of water a
3
different temperatures 6, the following pairs of values were obtained.

0 5 10 15

v=180 1-45 1-18 1-00

b0 which best fits to tnese


Obtain by the method of least squares, a relation of the form u =
a +

observations.
dissolve in 100 grams of
4 In the following table y is the weight of potassium bromide which will
water at temperature x. Find a linear law between x and y.

20 30 40 50 60 70
0 10
70 6 75-5 80 2 85-5 90
y gm 53-5 59.5 65 2

5. Fit a straight line to the following data


1971 1981 1991 2001
Year x 1961
10 12 10 16
Productiony: 8

(in thousand tons)


and find the expected production in 2006.
following data by the method of least squares
6. Fit a straight line y
=
a + bx to the
3 8

3 2 5 4

concentrated load P (l6) at its mid-point. Corresponding to


7. A beam carries a
simply supported
various values of P, the maximum deflection
Y (in) Is measured. The data are given below.
140 160 180 200
P: 100 120
0 60 0-70 0 80 0 85
Y: 0-45 0 55
Find a law of the form Y = a+ bP.
300
resistance R
of
SPECTRUUM ENGINEERING MATHE

a copper bar at various temner


NTHEMATCSA
temperatures fC
m e a s u r e m e n t of
clectric
8. The results of
listed below: 36 40 45
5 30 50
19 80 82 83
77 79
R 76 to be determined by you.
are constants
relation R a t br when a and b fits the followin
Find a
find the curve y =ax + br* that best
lowing data:
By the method of least squares 4
3 5
8.9 14 1
8 5 1 19.8
tbx + cx* which fits most closely with the observat. observations
10. Find the parabola of the form y =a

2 - 1 0 2
3
0 67 0-09 0-63 2 15
11.
4 63 2.11
ifV (km/hr.) and R (kg/tonne) are related by a relation of the type R = a t+ bVi, find by ther
4-58
11. by the metho
table:
of least squares, a and b with the help ofthe following
V: 10 20 30 40 50
R: 10 8 15 21 30
12. Fit a parabola y = a +br+cx to the following data
2 4 6 8 10
y: 3.07 12 85 91 29 31-47 57:38
13. The following table gives the results of the measurements of train resistances; V is the velocitv z
miles perhour. R is the resistance in pounds per ton:
V 20 40 60 80 100 120
R 5.5 9-1 14.9 22-8 33 3 46 0
IfR is related to V by the relation R =a+ bV + cV, find a, b and c
14. Fit a second degree parabola to the following data
2 3 4 5 6 7 8 9
y: 2 6 7 8 10 11 11 10
15. Fit a second degree parabola to the following data
x
2 3 5 6 8 9
y 6 7 8 10 11 11 10
(P.T.U. 201)

ANSWERS
1. P=2.2759 1879 W, P150 +0 30-4635 kg. 2. y= 13-6 (r)
3. v=
1:758-0-053 (0) 4. y- 54 35+ 5184 (x)
5. 15200 tons 6. y=1 6+ 38 (x)
7. Y- 004 (P) + 048 8. R 70 052 +0 292 ()
9. y=1:37 (x) +0 53 (x) 10. y= l-243 004 (x) +0 22 ()2
11. a=6 32, b 0 0095 =

12. y
13.
=0:34 0-78 x+0:99 r
R 3 48 002(V)+ 0029 V2 14. y-0-98x+3 55x-27
15. y-1-5223 +3847x-0-2997
ND
PRINCIPLE OF LEAST SQUARES 301
9.4 Fittingof Geometric Trend (y= ax
Let the
curve of
best fit is given by y= ax ..(1)
Taking log on both sides

logy=log a t b log x

or
y a + bX ; where Y log
=

y, ...(2)
a =

log a, X log X
=

Normal equation for this are given by

y n a + b2X

or EXy«X+62X*
Solving these for a and b, we can find a and b and from (1), we get the required curve Or de
fit.

ILLUSTRATIVE EXAMPLES
Example 1. The voltage V across a capacitor at time t second is given by the following table. using "

principle of least squares to fit a curve ofthe form v = a e to the data;

4 8

150 63 28 12 5-6

kt .(1)
equations of the curve is v
=
ae
Sol. The

Taking log on both sides we have


logio v logio a + k. t logio e
Let it be reduced to the form
.2)
Y=a +ßt

where Y =logiov, a
=
logio a, B=k logioe
Yt
Y = logio

0 0
150 2-1761
4 3 5956
1-7993
63 16 5 7888
A
14472
28 36 6.4752
1-0792
12 64 5.9856
8
0 7482
5.6 2r= 120 yt=21 8482
2 20
y = 7-25

The normal equations are

2 y=na +ß2r
XY=a+82r
and
SPECTRUM ENGINEERING MATHEMAT
302

Substituting the values


at4ß= 145
7:25 5a+ 20#
at6ß = 1-0924 .
and 21 8482 20 a + 120ß
Subtracting (3) from (4), we get
2--0-3576 --0.1788

a+4 (- 1788) = 145 a - 2-1652


146:4
(2.1652)=
2.1652= logioa
aA.L.
Now a =
logioa
B k.log10 e k = 1788 --0-4117
4343
from (1) equation of the curve becomes

V= 146.4 4117

Example 2. Fit a curve of the firm y =


ar to the data given below
4 5
2 3
110 161
27 8 62 1
y 7.1
.)
Sol. Equation of the curve is y= ax
Taking log on both sides
los10 logio a + b log10*

Let it be reduced to
logiox and ß =
b
=logio a, X
=

Y=a +ß X; where Y= log1o), a

X = log1oX x XY
Y log10
0-0000 0-0000 0-0000
71 0-8513
0-3010 0-0906 0-4346
27-8 1-4440
0-2276 0-8555
1 7931 3 0-4771
62 1 0-3625 1:2291
2.0414 0-6021
110
0-4886 1 5425
2.2068 5 0.6990
161
EX = 2.0792 2 X - 1.1693 EXY =4-0618
|2Y=8.3366

The normal equations are


EY na +B EX
EXY =a EX +8 EX
Substituting the values
5a+(2.0792) B-8.3366 0
8 3366 5 a + (2-0792) B =0
B-4-0618
(2-0792) a + (1 1693)B (2.0792)a (1 1693)
+
and 4-0618
a R V E F I T T I
G
N G

AND
,

PRINCIPLE OF LEAST SQU ARES 303


Solving (2)aand (3). weget

453+9.748017.3335 20 309 55 8465-4


8465-4.3231
3231
_.
3027 2.9755 15234
a - 0855l andß = 19532

a ,= 8551
logio a 8551 * a=
A.L. (-8551) =a= 7.163
8-1-9532 b=1.9532
from (1) equation of the curve of best fit is
y-7 163 ()9532
Example 3.
You are given the ollowing population figures
2001
Census Year (X): 1941 1951 1961 1971 1981 1991
54 7
Population (Y) (in crores) 25-0 25 1 27-9 31.9 36.1 43 9
Fit the e x p o n e n t i a l t r e n d y = A B * t o t h e a b o v e d a t a b y m e t h o d o fl e a s t s q u a r e s .

Origin = 1941 X =x/10 XY


Year ) Y log1o.
(x)
30 9 4-1937
1941 25-0 3 1-3979
-2.7994
1951 25 1 20 2 1 3997
- 1 4456
1961 27-9 - 10 -1 1.4456
0 1-5038 0 0 000
1971 31-9
1-5575 1 5575
1981 36-1 10 1
2 1 6425 3-2850
1991 43.9 20
3 1.7380 9 5-2140
2001 54-7 30
=1-6178
EX =0 2Y =10-6850 EX=281Eef 2XY
The exponential trend is
yA. B

Taking log on both sides


og10y log1o A + x log1o B
Let it be reduced to the form
Y a+bX
and X=x
where logioA, b logio B
Y -
log1o y, a=

The normal
equations are
2Y = n a+b 2X

and 2XY =
a EX + b EX*
304

Substituting the values we have SPECTRUM ENGINEERING MATHEMATIOS


10-6850 7a
and
16178 b (28)
From . log to A= 10 6850 = 15624

A A.L. (1 5624)
A 33:6
From I1. og1o B 6178
=0-0578
28
B A.L. (0578) B 1 142
Thus the exponential trend becomes
Y (33-6)(1-142)
Origin 1914, X unit = Ten Years

EXERCISE 9 (b)
.Given below are the figures of production (in thousand tonnes) of coal

1982 1983 1984 1985 1986


Year 1979 1981
83 90 100 98
70 85 94
Production
(in thousand tonnes)
method of least squares.
Fit a straight line by the
2. Fit a straight line trend to the given data

2 3 4
X .

40 55 68
14 27
y
from the data given below:
3. Fit a straight by the method of least squares
1979 1980 1981
1976 1977 1978
Year
85 91 98
77 88 94
Sales
goods from 1970 to 1976. Fit a parabolic trend
4. Given below are India's Exports of engineering
Y a +bX + cX^to the data.
1975 1976
1971 1972 1973 1974
Year 1970
299 404 550
I16-0 126-0 130 176
Exports Y (Rs. Cr.)

5. Fit a parabola to the given data


15 23 20
x 10 12
23 25 21
14 17
305
NG AND PRINCIPLE OF LEAST SQUARES
7RVEFITT
C exponentia curve y = a e " to the given data
Fit an
6.
5 9 12

10 15 21
15 12
Cit a Curve o f t h e form y = ax to the data given below

4 5
2 3
7.1 110 161
y 27.8 62.1

ANSWERS
2. y 13-6x 3. Y 88 83 1 5X
1 Y 88157+2-899X 889
r 303

39(X) 15.94 (X 5. y= 100


53+72 100
+

4Y = 193 100

6. y=9.475 959)x 7. y-7 1812 952

You might also like