0% found this document useful (0 votes)
3 views23 pages

Bmate301 Module 2

Module-2 covers statistical methods including correlation and regression analysis, focusing on Karl Pearson’s coefficient and its applications. It explains positive and negative correlations, provides examples, and outlines the method of least squares for curve fitting. Additionally, it includes problems to calculate correlation coefficients and regression lines for various datasets.

Uploaded by

pavangowdakatta
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)
3 views23 pages

Bmate301 Module 2

Module-2 covers statistical methods including correlation and regression analysis, focusing on Karl Pearson’s coefficient and its applications. It explains positive and negative correlations, provides examples, and outlines the method of least squares for curve fitting. Additionally, it includes problems to calculate correlation coefficients and regression lines for various datasets.

Uploaded by

pavangowdakatta
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

Module-2 - Statistical Methods & Curve Fitting

➢ Statistical Methods: Correlation and regression-Karl Pearson’s coefficient of correlation


and rank correlation -problems. Lines of regression, Angle between regression lines,
Regression analysis- lines of regression –problems.

➢ A
Curve Fitting: Curve fitting by the method of least squares- fitting the curves of the form-
D
y = ax+ b , y = a𝐱𝟐+ bx + c, y = a𝐞𝐛𝐱, y=a𝒙𝒃
AD
U
VT
Introduction
Correlation
So far, while explain measures of central tendency as well as measures of dispersion, one do
the analysis of observations on a single variable or univariate say x.

There are many phenomena where the changes in one variable are related to the changes in
the other variable. Suppose two variables x and y are related in such a way that an increase in
one is accompanied by an increase or decrease in the other. Such a relationship is called
Change in one variable followed by change in other variable is called correlation or
covariation

Positive Correlation
A positive correlation is a relationship between two variables where if one variable
increases( or decreases), the other one also increases(or decreases)

Example

A
D
Demand and price of a commodity are positively correlated as increase in one
results in increase in the other or vice versa.
AD

Negative Correlation or inverse correlation:


A negative correlation is a relationship between two variables where if one variable
U

increases(or decreases), the other one decreases( or increases)


VT

Example

Supply and price of a commodity are negatively correlated or inversely correlated


as increase in one results in decrease in the other or vice versa.
Uncorrelation
If there is no relationship indicated between two variables, are said to be uncorrelated
or independent.
Correlation and Regression

This topic deals with data concerning independent observations.

Examples:

1. Marks of individuals in two subjects


2. Height and weight of individuals
3. Amount involved in advertising a product and sale of product etc.,
We discuss the aspect of inter – relation between the independent variables.

• Correlation and Correlation Coefficient


The numerical measure of correlation between two variables x and y is known as

Pearson’s coefficient of correlation usually denoted by r and is defined as follows.

A
D
∑1𝑛(𝑥− 𝑥)(𝑦− 𝑦)
r= … (1)
AD

𝑛𝜎𝑥𝜎𝑦

This can be put in the alternative form as follows.


U

If X = x -𝑥 , Y = y-𝑦 we can write

Thus (1) becomes r= ∑ 𝑋𝑌


VT

√∑ 𝑋2 ∑ 𝑌2
Property :

The coefficient of correlation numerically does not exceed unity. ie -1 ≤ r ≤ +1.

Note : If r = ± 1 we say that x and y are perfectly correlated and if r = 0 we say that x
and y are non correlated.

• Alternative formula for the Correlation Coefficient r


2 2 2
𝜎 +𝜎 −𝜎
r = 𝑥 𝑦 𝑥−𝑦
2𝜎𝑥𝜎𝑦
Problems:

1. Calculate the karl – pearson co – efficient for the following ages of husband
and wife’s.
Roll No. 1 2 3 4 5 6 7 8 9 10
Husband’s age (x) 36 23 27 28 28 29 30 31 33 35
Wife’s age (y) 29 18 20 22 27 21 29 27 29 28

∑𝑋 300 ∑𝑌
Soln: 𝑥 = = = 30 𝑦= = 250 = 25 Here n = 10
10 10 10 10

x y X= x - 𝑥 Y = y -𝑦 XY X2 Y2
36 29 -7 -7 49 49 49
23 18 -3 -5 15 9 25
27 20 -2 -3 6 4 9
28
28
22
27
-2
-1
2
-4
A -4
4
4
1
4
16
D
29 21 0 4 0 0 16
30 29 1 2 2 1 4
AD

31 27 3 4 12 9 16
33 29 5 3 15 25 9
35 28 6 4 24 36 16
U

∑𝑥 ∑𝑦 ∑ 𝑋𝑌 ∑ 𝑋2 ∑ 𝑌2
VT

= 300 = 250 = 123 = 138 = 164


∑ 𝑋𝑌 123
We have r= , r= = 0.817
√∑ 𝑋2 ∑ 𝑌2 √(138)(164)

It is a positive correlation.

2. Obtain the correlation of the following data:

x 10 14 18 22 26 30
y 18 12 24 6 30 36
∑ 𝑋𝑌
Soln. We have r= where X = x - 𝑥 , Y = y -𝑦
√∑ 𝑋2 ∑ 𝑌2

Here n = 6
∑𝑋 120 ∑𝑌
𝑥 = = = 20 𝑦= = 126 = 21
10 6 10 6

x y X= x -𝑥 Y = y-𝑦 XY X2 Y2
10 18 -10 -3 30 100 9

14 18 -6 -9 53 36 81

18 18 -2 3 -6 4 9

22 18 2 -15 -30 4 225

26 18 6 9

A 54 36 81

30 10 15
D 150 100 225
18
AD

∑𝑥 ∑𝑦 ∑ 𝑋𝑌 ∑ 𝑋2 ∑ 𝑌2
= 120 = 126 = 252 = 280 = 630
U

252
VT

We have r= = 0.6
√(280)(630)

It is a positive correlation.
3. Calculate Karl pearson co-efficient of correlation b/w the marks obtained by 8 students in
mathematics and statistics :

Statistics 8 10 15 17 20 23 24 25
Mathematics 25 30 32 35 37 40 42 45

Solu: Let statistics = x , Mathematics = y

∑ 𝑋𝑌
We have r= where X = x - 𝑥 , Y = y -𝑦
√∑ 𝑋2 ∑ 𝑌2
Here n = 8
∑𝑋 142 ∑𝑌
𝑥 = = = 17.75 𝑦= = 286 = 35.75
𝑛 8 𝑛 8

x y X= x - Y = y- XY X2 Y2
𝑥 𝑦
8 25 -9.75 -10.75 104.81 95.06 115.56
10 30 -7.75 -5.75 44.56 60.06 33.06
15 32 -2.75 -3.75 10.31 7.56 14.06
17 35 -0.75 -0.75 0.56 0.56 0.56
20 37 2.25 1.25 2.81 5.06 1.56
23 40 5.25 4.25 22.31 27.56 18.06
24 42 6.25 6.25 39.06 39.06 39.06
25 45 7.25

A
9.25 67.06 56.56 85.56
D
∑𝑥 ∑𝑦 ∑ 𝑋𝑌 ∑ 𝑋2 ∑ 𝑌2
= 17.75 = 35.75 = 291.4 = 291.480 = 307.48
AD

291.48
We have r= = 0.97
U

√(291.48)(307.48)

It is a positive correlation.
VT

Regression
Regression is an estimation of one independent variable in terms of the other. If x & y are
correlated, the best fitting straight line in the least square sense gives reasonably a good
relation between x & y.

The best fitting straight line of the form y = ax + b (x being the independent variable) is
called the regression line of y on x & x = ay + b (y being the independent variable) is called
the regression line of x on y.

Formulas for line of regression

Let y = ax + b be the equation of the regression line of y on x for a given set of n values (x,y).
𝜎𝑦
Then y- 𝑦= 𝑟 (x-𝑥)…..............(1)
𝜎𝑥
This is the regression of y on x.

Similarly,
𝜎𝑥
x- 𝑥 = 𝑟 (y-𝑦)… .......... (2)
𝜎𝑦

This is the regression line of x on y.


𝜎𝑦
The coefficient of x in (1) & the coefficient of y in (2) respectively given by r and r 𝜎𝑥 are
𝜎𝑥 𝜎𝑦
known as the regression coefficients. Their product is equal to 𝑟2.

Thus we can conclude that r is the geometric mean (GM) of the regression coefficients since
the GM of two numbers a, b is √𝑎𝑏. That is

r = ±√(𝑐𝑜𝑒𝑓𝑓. 𝑜𝑓 𝑥)(𝑐𝑜𝑒𝑓𝑓. 𝑜𝑓 𝑦)

The sign of r will be positive or negative according as the regression coefficients are positive
or negative.
A
D
Note: The lines of regression (1) & (2) are also of the form
AD

∑ 𝑋𝑌 ∑ 𝑋𝑌
Y= (X) and X = (Y) Where X= x- 𝑥 & Y= y- 𝑦.
∑ 𝑋2 ∑ 𝑌2

This form will be useful to find out the coefficient of correction by first obtaining the lines of
U

regression as we have deduced that


VT

r = ±√(𝑐𝑜𝑒𝑓𝑓. 𝑜𝑓 𝑥)(𝑐𝑜𝑒𝑓𝑓. 𝑜𝑓 𝑦)

Problems:

1. Compute the coefficient of correlation & the equation of the lines of regression for the
following data.

x 1 2 3 4 5 6 7
y 9 8 10 12 11 13 14

∑ 𝑋𝑌
Solu: We have coefficient of correlation r =
√∑𝑋 2 ∑𝑌 2

Where Y = y- 𝑦 X= x- 𝑥 Here n = 7
∑𝑥 ∑𝑦
𝑥 = = 28/7 = 4 𝑦= = 77/7 = 11
𝑛 𝑛
X y X= x- 𝑥 Y= y- 𝑦 XY 𝑋2 𝑌2
1 9 -3 -2 6 9 4
2 8 -2 -3 6 4 9
3 10 -1 -1 1 1 1
4 12 0 1 0 0 1
5 11 1 0 0 1 0
6 13 2 2 4 4 4
7 14 3 3 9 9 9
∑ 𝑥 = 28 ∑𝑦 ∑ 𝑋𝑌 = 26 ∑ 𝑋2=28 ∑ 𝑌2=28

= 77

Line regression y on x Line regression x on y


∑ 𝑋𝑌 ∑ 𝑋𝑌
Y= .X X= .Y
∑ 𝑋2 ∑ 𝑌2
y- 𝑦= 26 (x- 𝑥) x-4 = 26 (y-11)
28 28
y-11 = 0.928 (x-4)
y = 0.92x + 7.29
A x-4 = 0.928y -10.208
x = 0.928y-6.208
D
AD

2. Obtain the lines of regression and hence find the co-efficient of correlation for the
following data
x 1 3 4 2 5 8 9 10 13 15
U

y 8 6 10 8 12 16 16 10 32 32
Solution:
VT

∑𝑥 ∑𝑦
𝑥 = = 70/10 = 7 𝑦= = 150/10 =15
𝑛 𝑛

x y X= x- 𝑥 Y= y- 𝑦 xy 𝑋2 𝑌2
1 8 -6 -7 42 36 49
3 6 -4 -9 35 16 81
4 10 -3 -5 15 9 25
2 8 -5 -7 35 25 49
5 12 -2 -3 6 4 9
8 16 1 1 1 1 1
9 16 2 1 2 4 1
10 10 3 -5 -15 9 25
13 32 6 17 102 36 289
15 32 8 17 136 64 289
∑ 𝑥 = 10 ∑ 𝑦 = 150 ∑ 𝑋𝑌 = 360 ∑ 𝑋2 = 204 ∑ 𝑌2 = 818
Line of regression y on x line of regression x on y
∑ 𝑋𝑌 ∑ 𝑋𝑌
Y= .X X= .Y
∑ 𝑋2 ∑ 𝑌2

y- 𝑦= 360/204( x- 𝑥 ) x- 7 = 360 (y-15)


818

y-15 = 1.764 (x-7) x- 7 = 0.44y + 6.6

y-15 = 1.764x-12.348 x = 0.44y + 0.4

y = 1.764x-12.348+15

y = 1.764x + 2.652

We have Co-efficient of correlation r = ±√(𝑐𝑜𝑒𝑓𝑓. 𝑜𝑓 𝑥)(𝑐𝑜𝑒𝑓𝑓. 𝑜𝑓 𝑦) = 0.88

A
2. Compute the coefficient of correlation & the equation of the lines of regression for the following
data.
D
x 10 14 18 22 26 30
AD
y 18 12 24 6 30 36

∑𝑥 120 ∑𝑦
Soln: 𝑥 = = = 20 𝑦= = 126 = 21
U

𝑛 6 𝑛 6

x y X= x- 𝑥 Y= y- 𝑦 XY 𝑋2 𝑌2
VT

10 18 -10 -3 30 100 9
14 12 -6 -9 54 36 81
18 24 -2 3 -6 4 9
22 6 2 -15 -30 4 225
26 30 6 9 54 36 81
30 36 10 15 150 100 225
∑𝑥 ∑𝑦 ∑ 𝑋𝑌 ∑ 𝑋2=280 ∑ 𝑌2=630

= 120 = 126 = 252

∑ 𝑋𝑌
We have, Coefficient of correlation r = = 0.6
√∑𝑋 2 ∑𝑌 2

Line of regression y on x line of regression x on y


∑ 𝑋𝑌 ∑ 𝑋𝑌
Y= .X X= .Y
∑ 𝑋2 ∑ 𝑌2
y- 𝑦= 252 ( x- 𝑥 ) ( x- 𝑥 ) = 252
(y- 𝑦)
280 630

y – 21 = 0.9 ( x – 20) x – 20 = 0.4 ( y – 21)

y = 0.9 x – 18+21 x = 0.4y -8.4 + 20

y = 0.9 x + 3 x = 0.4 y +11.6


3. If 𝜃 is the acute angle between the lines of regression, then show that
𝜎 𝑥 𝜎𝑦 1− 𝑟2
tan 𝜃 = ( ).Explain the significance when r = 0 & r = ± 1.
𝜎𝑥2+ 𝜎𝑦2 𝑟

Solu: W. K. T If is 𝜃 acute, the angle between the lines y = m1 x + c1 and y = m2 x +c2 is given by
𝑚 2− 𝑚 1
tan 𝜃 =
1+ 𝑚1 𝑚2

We have the lines of regression ,

y - 𝑦= r
𝜎𝑦
( x - 𝑥) A
…. (1)
D
𝜎𝑥
AD

and ( x - 𝑥) = r 𝜎𝑥 (y - 𝑦)
𝜎𝑦
𝜎𝑦
We write the second of the equation as y - 𝑦= ( x - 𝑥) ….(2)
𝑟𝜎𝑥
U

Slope of (1) and (2) are respectively given by


VT

𝜎𝑦 𝜎𝑦
m1 = r and m2 =
𝜎𝑥 𝑟𝜎𝑥

Substituting these in the formula for tan 𝜃 we have,


𝜎𝑦 𝜎𝑦
r 𝜎𝑥 − 𝑟𝜎𝑥
tan 𝜃 = 𝜎𝑦
1+ r 𝜎𝑦
𝜎𝑥 𝑟𝜎𝑥
𝜎𝑥 𝜎𝑦 1− 𝑟2
tan 𝜃 = ( )
𝜎𝑥2+ 𝜎𝑦2 𝑟

If r = ± 1 , tan 𝜃 = 0 → 𝜃 = 0,which implies that the two regression lines


coincide and hence the variables are perfectely correlated. Also if r = 0 , tan 𝜃 = ∞
or 𝜃 =𝜋. This implies that the lines are perpendicular and hence the variables are
2
[Link] a partially destroyed record, only the lines of regression of y on x
and x on y are available as 4x – 5y + 33 = 0 and 20x – 9y = 107 respectively.
Calculate 𝑥 , 𝑦 and the coefficient of correlation between x and y.

Solu. W .K .T regression lines passes through 𝑥 and 𝑦

4𝑥 -5 𝑦 = -33 and 20𝑥 - 9 𝑦 = 107

By solving we get 𝑥 = 13 𝑦= 17

We shall now rewrite the equation of the regression lines to find the regression

coefficients.

5y = 4x + 33 or y = 0.8 x + 6.6 ….(1)

20x = 9y + 107 or x = 0.45y + 4.35 …(2)

A
D
r = ± √(𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑥 )(𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑦) = ± √(0.8)(0.45) ,
AD

r = 0.6

It is a positive correlation
U

5 ) In a partially destroyed laboratory data, only the regression lines with equations
3𝑥 + 2𝑦 = 26, and
VT

6𝑥 + 𝑦 = 31 are available. Calculate the means of 𝑥′𝑠 , means of 𝑦′𝑠 and the
correlation co-efficient.

Solution: Since the regression lines passes through (𝑥, 𝑦),


3𝑥 + 2𝑦 = 26 𝑎𝑛𝑑 6𝑥 + 𝑦 = 31 .
By solving above two equations we get, 𝑥 = 4, 𝑦 = 7 .
1 31
Given regression lines are 𝑦 = − 3 𝑥 + 13 and 𝑥 = − 6 𝑦 + 6 .
2
Since co-efficient of correlation is geometric mean between the two regressions
coefficients
3 1
𝑟 = √− × − = −0.5
2 6

(−ve sign is taken since both the regressions coefficients are –ve)
Rank Correlation and an expression for the rank correlation coefficient.

The coefficient of correlation in respect of the ranks of some two characteristics of an


individual or an observation is called Rank Correlation Coefficient usually denoted by ρ

We now proceed to derive an expression for ρ in the following form.

6 ∑(𝑥−𝑦)2 ∑ 𝑑2
or 1 - 6
ρ =1-
𝑛 (𝑛2− 1) 𝑛 (𝑛2− 1)

Note:

(1) If the ranking of x ,y are entirely in the same order like for example, x :1 1,2,3,4,5 ; y :
1,2,3,4,5 then ∑ 𝑑2 = ∑(𝑥 − 𝑦 )2 = 0. This will give us 𝜌 = ± 1 and is called perfect
direct correlation.
If the ranking of x and y are entirely in the opposite order like for example, x :
1,2,3,4,5

A
y : 5,4,3,2,1 then ∑ 𝑑2 = [Link] will give us ρ = -1 and is called perfect inverse
D
correlation.
AD

Problems:

1. Ten competitors in a beauty contest are ranked by two judges in the following
order. Compute the coefficient of correlation
U

I 1 6 5 3 10 2 4 9 7 8
VT

II 6 4 9 8 1 2 3 10 5 7
6 ∑ 𝑑2
Soln : We have ρ =1-
𝑛 (𝑛2− 1)

For the given data, n = 10 and

∑ 𝑑2 = (1 − 6)2 + (6 − 4)2+(5 − 9)2 + (3 − 8)2 +(10 − 1)2 +(2 − 2)2 +(4 − 3)2 + (9 − 10)2

+ (7 − 5)2 +(8 − 7)2

= 25 + 4+ 16 + 25 + 81 + 0 +1 +1 + 4 + 1 =158
6 (158)
Hence 𝜌 = 1 – = 0.042Ten students got the following percentage of marks
10(102 − 1)
in two subjects x and y. Compute their rank correlation coefficient.
Marks in x 78 36 98 25 75 82 90 62 65 39
Marks in y 84 51 91 60 68 62 86 58 53 47

Soln : We prepare the table consisting of the given data along with the ranks assigned
according to their order of the magnitude. In the subject x, 98 will be awarded
rank 1, 90 as rank 2 and so on.

Marks in x Rank(x) Marks in y Rank(y) d = (x-y) 𝑑2 = (𝑥 − 𝑦)2


78 4 84 3 1 1
36 9 51 9 0 0
98 1 91 1 0 0
25 10 60 6 4 16
75 5 68 4 1 1
82 3 62 5 -2 4
90 2 86 2 0 0
62
65
7
6
58
53
A 7
8
0
-2
0
4
D
39 8 47 10 -2 4
∑ 𝑑2 = 30
AD

6 ∑ 𝑑2
We have ρ =1- and n = 10 for the given data.
U

𝑛 (𝑛2− 1)
VT

6 (30)
=1- 10(102− 1)

= 0.82

2. Ten competitors in music contest are ranked by 3 judges A, B,C in the following order.

Use the rank correlation coefficient to decide which pair of judges have the nearest

. approach to common taste of music

A 1 6 5 10 3 2 4 9 7 8
B 3 5 8 4 7 10 2 1 6 9
C 6 4 9 8 1 2 3 10 5 7

Soln : We shall compute 𝜌𝐴𝐵 , 𝜌𝐵𝐶 , 𝜌𝐶𝐴 with the help of the following table where d is
the difference in ranks.

A B C 2
𝑑𝐴𝐵 𝑑2𝐵𝐶 2
𝑑𝐶𝐴
1 3 6 4 9 25
6 5 4 1 1 4
5 8 9 9 1 16
10 4 8 36 16 4
3 7 1 16 36 4
2 10 2 64 64 0
4 2 3 4 1 1
9 1 10 64 81 1
7 6 5 1 1 4
8 9 7 1 4 1
∑ 𝑑2 ∑ 𝑑2 ∑ 𝑑2
𝐴𝐵 𝐵𝐶 𝐶𝐴
= 200 = 214 = 60
∑ 𝑑2
We have ρ = 1 - 6
and n = 10 for the given data.
𝑛 (𝑛2− 1)

6 (200)
A 6 (214)
D
Now, 𝜌𝐴𝐵 = 1 - 10(102− 1) = - 0.21 , 𝜌𝐵𝐶 = 1-
10(102− 1)
= - 0.297
AD
6 (60)
𝜌𝐶𝐴 = 1-
10(102− 1)
= + 0.636

It may be observed that 𝜌𝐴𝐵 and 𝜌𝐵𝐶 are negative which means their tastes
(A &B; B &C) are opposite. But 𝜌𝐶𝐴 is positive and is nearer to 1.(perfect correlation)
U
VT

CURVE FITTING

CONTENTS:
❖ Curve fitting by the method of least squares
❖ Fitting of curves of the form
y = ax+ b
y = ax2+ bx + c
y = aebx
CURVE FITTING

CURVE FITTING [BY THE METHOD OF LEAST SQUARE]:


We can plot ‘n’ points (𝑥𝑖, 𝑦𝑖) where i=0,1,2,3,………
At the XY plane. It is difficult to draw a graph y=f(x) which passes through all these
points but we can draw a graph which passes through maximum number of point. This
curve is called the curve of best fit. The method of finding the curve of best fit is
called
the curve fitting.

FITTING A STRAIGHT LINE Y = AX + B:

We have straight line that sounds as best approximate to the actual curve y=f(x)
passing through ‘n’ points (𝑥𝑖, 𝑦𝑖 ) , i=0,1.2 ............. n equation of a straight
line is
y = a + bx (1)
A
D
Then for ‘n’ points (2) i i Y =(a+𝑏𝑥𝑖) .......... (2)
AD

Where a and b are parameters to be determined; Yi is called the estimated


value. The given value Yi corresponding to xi .
Normal equations are ∑ 𝑦 = 𝑛𝑎 + 𝑏 ∑ 𝑥 , ∑ 𝑥𝑦 = 𝑎 ∑ 𝑥 + 𝑏 ∑ 𝑥2
U

Where ‘n’ is the number of points or value.


VT

FITTING A SECOND DEGREE PARABOLA Y=A𝑿𝟐 + BX + C:

Let us take equation of parabola called parabola of best fit in the form

y= a𝑥2 + bx + c
normal equations are
∑ 𝑦 = 𝑎 ∑ 𝑥2 + 𝑏 ∑ 𝑥 + 𝑛𝑐
∑ 𝑥𝑦 = 𝑎 ∑ 𝑥3 + 𝑏 ∑ 𝑥2 + 𝑐 ∑ 𝑥

∑ 𝑥2𝑦 = 𝑎 ∑ 𝑥4 + 𝑏 ∑ 𝑥3 + 𝑐 ∑ 𝑥2
Fit a curve of the form y=a𝒃𝒙:

Consider y=a𝑏𝑥 …….(1)


Take log on both side
log y = log(a𝑏𝑥)
log y =log a + log 𝑏𝑥
∴ Y=A+Bx …….(2) ; log y = Y → 𝑦 = 𝑒𝑌 ,
log a = A → 𝑎 = 𝑒𝐴
log b = B → 𝑏 = 𝑒𝐵
Corresponding normal equations are

∑ 𝑌 = 𝑛𝐴 + 𝐵 ∑ 𝑥 …..(3)

∑ 𝑥𝑌 = 𝐴 ∑ 𝑥 + 𝐵 ∑ 𝑥2 …..(4)

Solving the normal equation (3) & (4) for a & b . Substitute these values in (1) we get
curve of best fit of the form y= 𝑎𝑏𝑥

A
D
PROBLEMS:
AD

1. Fit a straight line y=a+bx to the following data

x: 5 10 15 20 25
U

y: 16 19 23 30 26
VT

Soln : Let y =a + b x ……(1)


Normal equations are ∑ 𝑦 = 𝑛𝑎 + 𝑏 ∑ 𝑥 …..(2)

∑ 𝑥𝑦 = 𝑎 ∑ 𝑥 + 𝑏 ∑ 𝑥2 …..(3)

x y 𝑥2 xy
5 16 25 80
10 19 100 190

15 23 225 345
20 26 400 520
25 30 625 750
∑ 𝑥 = 75 ∑ 𝑦 = 114 ∑ 𝑥2 = 1375 ∑ 𝑥𝑦 = 1885

From (2) & (3),


114 = 15a +75b
1885 =75a +1375b
a = 12.3, b = 0.7
Becomes y = 12.3 + 0.7 x

2. Fit a straight line y=a+bx to the following data

x: 1 2 3 4 5
y: 14 13 9 5 2
Soln : Let y =a + b x ……(1)

Normal equations are ∑ 𝑦 = 𝑛𝑎 + 𝑏 ∑ 𝑥 …..(2)

x y 𝑥2 xy

1 14 1 14

2 13

A 4 26

3 9
D 9 27

4 5 16 20
AD

5 2 25 10

∑ 𝑥 = 15 ∑ 𝑦 = 43 ∑ 𝑥2 = 55 ∑ 𝑥𝑦 = 97
U
VT

∑ 𝑥𝑦 = 𝑎 ∑ 𝑥 + 𝑏 ∑ 𝑥2 …..(3 )

From (2) & (3),

43 15a +15b , 97=15a +56b , a = 18.2 ,,b = -3.2 equn(1)Becomes y = 18.2 -3.2 x

3. Fit a straight line y=a+bx to the following data

x: 0 1 2 3 4
y: 1 1.8 3.3 4.5 6.3
Soln : Let y =a + b x ……(1)

Normal equations are ∑ 𝑦 = 𝑛𝑎 + 𝑏 ∑ 𝑥 …..(2)

∑ 𝑥𝑦 = 𝑎 ∑ 𝑥 + 𝑏 ∑ 𝑥2 …..(3)

X y 𝑥2 xy

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

∑ 𝑥 = 10 ∑ 𝑦 = 16.9
A
∑ 𝑥2 = 30 ∑ 𝑥𝑦 = 47.1
D
AD

From (2) & (3),


16.9 = 5a +10b
47.1 =10a +30b
a = 0.72
U

b = 1.33
equ(1)Becomes y = 0.72 + 1.33 x
VT

4. If p is the pull required to lift a load by means of pulley block. Find a linear
block of the form p=MW+C Connected p &w using following data
w: 50 70 100 120
p: 12 15 21 25 Compute p when W=150.

Soln: Given p=y & W=x


Equation of straight line is y =a + b x ……(1)
Normal equations are ∑ 𝑦 = 𝑛𝑎 + 𝑏 ∑ 𝑥 …..(2)

∑ 𝑥𝑦 = 𝑎 ∑ 𝑥 + 𝑏 ∑ 𝑥2 …..(3)
x y 𝑥2 xy
50 12 2,500 600
70 15 4,900 1,050
100 21 10,000 2,100

120 25 14,400 3,000

∑ 𝑥 = 340 ∑ 𝑦 = 73 ∑ 𝑥2 = 31,800 ∑ 𝑥𝑦 = 6,750

From (2) & (3),


73 = 4a +340b , 6750=340a +31800b
a = 2.27 , b = 0.187
Becomes y = 2.27 + 0.187 x ,
Put w=150 , in (1) y = 30.32

4. Fit a parabola y= a+𝒃𝒙 + 𝒄𝒙𝟐


A
for the following data
D
x: 1 2 3 4
Y: 1.7 1.8 2.3 3.2
AD

Soln : y= a+𝑏𝑥 + 𝑐𝑥2 (1)


Normal equations are
∑ 𝑦 = 𝑛𝑎 + +𝑐 ∑ 𝑥2 (2)
U

∑ 𝑥𝑦 = 𝑎 ∑ 𝑥 + 𝑏 ∑ 𝑥2 + 𝑐 ∑ 𝑥3 (3)
VT

∑ 𝑥2𝑦 = 𝑎 ∑ 𝑥2 + 𝑏 ∑ 𝑥3 + 𝑐 ∑ 𝑥4 (4)
x y 𝑥2 𝑥3 𝑥4 xy
𝑥2𝑦
1 1.7 1 1 1 1.7 1.7

2 1.8 4 8 16 3.6 7.2

3 2.3 9 27 81 6.9 20.7

4 3.2 16 64 256 12.8 51.2

∑ 𝑥 = 10 ∑𝑦 = 9 ∑ 𝑥2 = 30 ∑ 𝑥3 = 100 ∑ 𝑥4 = 354 ∑ 𝑥𝑦 = 25 ∑ 𝑥2𝑦 = 80.8


From (1) ,(3) & (4)
9=4a+10b+30c
25=10a+30b+100c
80.8=30a+100b+354c
a=2, b=-0.5, c=0.2
(1) Becomes y = 2 − 0.5𝑥 + 0.2(𝑥)2

4. Fit a curve of the form y=a𝒆𝒃𝒙 for the following data


x: 0 2 4
y: 8.12 10 31.82
Soln : Let y= 𝑎𝑒𝑏𝑥 ……(1)
Normal equations are
∑ 𝑌 = 𝑛𝐴 + 𝑏 ∑ 𝑥 …..(2) log y = Y → 𝑦 = 𝑒𝑌 ,
log a = A → 𝑎 = 𝑒𝐴
∑ 𝑥𝑌 = 𝐴 ∑ 𝑥 + 𝑏 ∑ 𝑥2 …..(3)

X y Y=logy
A 𝑥2 xY
D
0 8.12 2.093 0 0
2 10 2.302 4 4.604
AD

4 31.82 3.46 16 13..84

∑𝑥= 6 ∑ 𝑌 = 7.86 ∑ 𝑥2 = 20 ∑ 𝑥𝑌 = 18.444


U

From (2) & (3),7.856 = 3A +6b , 18.444=6A +20b ,


VT

A = 1.935, B=0.341 , Then 𝑒 𝐴 = 𝑎 = 6.924 , Becomes y = 6.924𝑒0.341𝑥

5. Fit a II degree parabola y= 𝒂𝒙𝟐 + 𝒃𝒙 + 𝒄 to the least square method &


find y when x=6

x: 1 2 3 4 5

y: 10 12 13 16 19

Soln : Let y= a𝑥2 + bx + c (1)


Normal equations are
∑ 𝑦 = 𝑎 ∑ 𝑥2 + 𝑏 ∑ 𝑥 + 𝑛𝑐 (2)

∑ 𝑥𝑦 = 𝑎 ∑ 𝑥3 + 𝑏 ∑ 𝑥2 + 𝑐 ∑ 𝑥 (3) , ∑ 𝑥2𝑦 = 𝑎 ∑ 𝑥4 + 𝑏 ∑ 𝑥3 + 𝑐 ∑ 𝑥2 (4)


x y 𝑥2 𝑥3 𝑥4 xy
𝑥2𝑦
1 10 1 1 1 10 10

2 12 4 8 16 24 14

3 13 9 27 81 39 117

`4 16 16 64 256 64 256

5 19 25 125 625 95 475

∑ 𝑥 = 15 ∑ 𝑦 = 70 ∑ 𝑥2 = 55 ∑ 𝑥3 = 225 ∑ 𝑥4 = 979 ∑ 𝑥𝑦 = 232 ∑ 𝑥2𝑦


= 906

70 =5c+ 15b +55a


232= 15c+ 55b+ 225a
906 =55c+ 225b+ 979a
a=0.285 , b=0.485 , c=9.4 A
D
(1) Becomes
AD

y= 0.285𝑥2+ 0.485x+ 9.4 , at x=6, y=22.6

6. The revolution 𝒓 and the time 𝒕 are related by 𝒓 = 𝒂𝒕𝟐 + 𝒃𝒕 + 𝒄 , Estimate the number of
U

revolutions for time 3.5 units. Given that,


VT

Revolution 5 10 15 20 25 30 35
time 1.2 1.6 1.9 2.1 2.4 2.6 3

Sol: Normal equations for the curve 𝑟 = 𝑎𝑡2 + 𝑏𝑡 + 𝑐 are


𝑎 ∑ 𝑡4 + 𝑏 ∑ 𝑡3 + 𝑐 ∑ 𝑡2 = ∑ 𝑡2𝑟
𝑎 ∑ 𝑡3 + 𝑏 ∑ 𝑡2 + 𝑐 ∑ 𝑡 = ∑ 𝑡 𝑟 ⋯ ⋯ ⋯ (1)
𝑎 ∑ 𝑡2 + 𝑏 ∑ 𝑡 + 𝑛𝑐 = ∑ 𝑟
From the given data
𝑛 = 7 , ∑ 𝑡4 = 200.9826 , ∑ 𝑡3 = 80.344 , ∑ 𝑡2 = 33.54, ∑ 𝑡 = 14.8
.
∑ 𝑡2𝑟 = 836.95, ∑ 𝑡 𝑟 = 335.5 , ∑ 𝑟 = 140. ⋯ ⋯ ⋯ (2)
Substituting in the normal equations, we get
200.9826 𝑎 + 80.344𝑏 + 33.54𝑐 = 836.95 𝑎 = 0.6646
80.344𝑎 + 33.54𝑏 + 14.8𝑐 = 335.5 ⟹ 𝑏 = 14.7795
33.54𝑎 + 14.8𝑏 + 7𝑐 = 140 𝑐 = −14.4322
Therefore 𝑟 = 0.6646𝑡2 + 14.7795𝑡 − 14.4322 .

And hence 𝑟(3.5) = 45.4374.

7) Fit a curve 𝒚 = 𝒂𝒆𝒃𝒙 for the following data,

𝑥 1 5 7 9 12
𝑦 10 15 12 15 21

Sol: For the curve 𝑦 = 𝑎𝑒𝑏𝑥 , taking log, log 𝑦 = log 𝑎 + 𝑏𝑥

Or 𝑌 = 𝐴 + 𝑏𝑥. Where 𝑌 = log 𝑦, 𝐴 = log 𝑎. ⋯ ⋯ ⋯ (1)


Normal equations are, 𝑛𝐴 + 𝑏 ∑ 𝑥 = ∑ 𝑌 and 𝐴 ∑ 𝑥 + 𝑏 ∑ 𝑥2 = ∑ 𝑥𝑌 . ⋯ ⋯ ⋯ (1)
From the given data, 𝑛 = 5.
∑ 𝑥 = 34. ∑ 𝑌 = ∑ loge 𝑦 = 13.2481
∑ 𝑥2 = 300. ∑ 𝑥𝑌 = ∑ 𝑥 loge 𝑦 = 94.1439. ⋯ ⋯ ⋯ (2)
Substituting in the normal equations, we get
5𝐴 + 34𝑏 = 13.2481

A
34 𝐴 + 300𝑏 = 94.1439.
D
⟹ 𝐴 = 2.2487, 𝑏 = 0.0590. .
And 𝑎 = 𝑒 𝐴 = 9.4754. ∴ 𝑦 = 9.4754𝑒0.0590𝑥 .
AD

1. Fit a curve of the curve y=a𝒙𝒃 for the data

x: 1 1.5 2 2.5
U

y: 2.5 5.61 10.0 15.6


Soln : Let y= 𝑎𝑥𝑏 ……(1)
VT

Normal equations are


∑ 𝑌 = 𝑛𝐴 + 𝐵 ∑ 𝑥 …..(2) log y = Y → 𝑦 = 𝑒𝑌 , log a = A → 𝑎 = 𝑒𝐴
∑ 𝑋𝑌 = 𝐴 ∑ 𝑋 + 𝐵 ∑ 𝑋2 …..(3) log x = X → 𝑥 = 𝑒𝑋

x y X=logx Y=logy 𝑋2 XY
1 2.5 0 0.916 0 0
1.5 5.62 0.405 1.726 0.164 0.699
2 10.0 0.693 2.302 0.480 1.595
2.5 15.6 0.916 2.747 0.839 2.516

∑ 𝑋 = 2.014 ∑ 𝑌 = 7.691 ∑ 𝑋2 = 1.483 ∑ 𝑋𝑌 = 4.81


VT
U
AD
D
A

You might also like