Unit - 4
Curve Fitting and Regression Analysis
Q1) Fit a straight line to the following data regarding x as the independent variables:
X | 0 | 1 | 2 | 3 | 4 |
Y | 1 | 1.8 | 3.3 | 4.5 | 6.3 |
A1)
The equation of straight line is
And the normal equations
We construct the data table:
X | Y | XY | |
0 1 2 3 4 | 1 1.8 3.3 4.5 6.3 | 0 1.8 6.6 13.5 25.2 | 0 1 4 9 16 |
Total | 16.9 |
Here (no. Of steps)
Substituting the values from table in normal equations:
16.9=5a+10b
47.1=10a+30b
On solving we getand
Therefore, the required equation of the straight line is .
Q2) Find the straight line that best fits of the following data by using method of least square.
X | 1 | 2 | 3 | 4 | 5 |
y | 14 | 27 | 40 | 55 | 68 |
A2)
Suppose the straight line
y = a + bx…….. (1)
Fits the best-
Then-
x | y | Xy | |
1 | 14 | 14 | 1 |
2 | 27 | 54 | 4 |
3 | 40 | 120 | 9 |
4 | 55 | 220 | 16 |
5 | 68 | 340 | 25 |
Sum = 15 | 204 | 748 | 55 |
Normal equations are-
Put the values from the table, we get two normal equations-
On solving the above equations, we get-
So that the best fit line will be- (on putting the values of a and b in equation (1))
Q3) Fit a second-degree parabola to the following data regarding x as an independent variable:
X | 0 | 1 | 2 | 3 | 4 |
Y | 1 | 5 | 10 | 22 | 38 |
A3)
The equation of second-degree curve is
The normal equations are
We construct the data table:
X | Y | |||||
0 1 2 3 4 | 1 5 10 22 38 | 0 1 4 9 16 | 0 1 8 27 64 | 0 1 16 81 256 | 0 5 20 66 152 | 0 5 40 198 608 |
Total | = 76 | 30 | 100 | 354 | 243 | 851 |
Substituting these values from the table in the above equations
On solving we get and
Therefore, equation of parabola is
Q4) Find the best values of a and b so that y = a + bx fits the data given in the table
x | 0 | 1 | 2 | 3 | 4 |
y | 1.0 | 2.9 | 4.8 | 6.7 | 8.6 |
A4)
y = a + bx
x | y | Xy | |
0 | 1.0 | 0 | 0 |
1 | 2.9 | 2.0 | 1 |
2 | 4.8 | 9.6 | 4 |
3 | 6.7 | 20.1 | 9 |
4 | 8.6 | 13.4 | 16 |
x = 10 | y= 24.0 | xy = 67.0 |
Normal equations, y= na+ bx (2)
On putting the values of
On solving (4) and (5) we get,
On substituting the values of a and b in (1) we get
Q5) Predict y at x = 3.75 by fitting a power curve to the given data
X | 1 | 2 | 3 | 4 | 5 | 6 |
Y | 2.98 | 4.26 | 5.21 | 6.10 | 6.80 | 7.50 |
A5)
Given equation is
Taking log on both sides,
Let
Therefore, its normal equation is
We construct the data table:
XY | |||||
1 2 3 4 5 6 | 2.98 4.26 5.21 6.10 6.80 7.50 | 0 0.301030 0.477121 0.602060 0.698970 0.778151 | 0.474216 0.629410 0.716838 0.785330 0.832509 0.875061 | 0 0.189471 0.342018 0.472816 0.581899 0.680930 | 0 0.090619 0.227644 0.362476 0.488559 0.605519 |
Total
|
|
Substituting the values from the table in the above equations
On solving we get
Hence the required equation is
So,
Q6) Fit a second-degree parabola to the following data by least squares method.
1929 | 1930 | 1931 | 1932 | 1933 | 1934 | 1935 | 1936 | 1937 | |
352 | 356 | 357 | 358 | 360 | 361 | 361 | 360 | 359 |
A6)
Taking
Taking
The equation is transformed to
1929 | -4 | 352 | -5 | 20 | 16 | -80 | -64 | 256 |
1930 | -3 | 360 | -1 | 3 | 9 | -9 | -27 | 81 |
1931 | -2 | 357 | 0 | 0 | 4 | 0 | -8 | 16 |
1932 | -1 | 358 | 1 | -1 | 1 | 1 | -1 | 1 |
1933 | 0 | 360 | 3 | 0 | 0 | 0 | 0 | 0 |
1934 | 1 | 361 | 4 | 4 | 1 | 4 | 1 | 1 |
1935 | 2 | 361 | 4 | 8 | 4 | 16 | 8 | 16 |
1936 | 3 | 360 | 3 | 9 | 9 | 27 | 27 | 81 |
1937 | 4 | 359 | 2 | 8 | 16 | 32 | 64 | 256 |
Total |
|
Normal equations are
On solving these equations, we get
Q7) Find the least squares approximation of second degree for the discrete data
x | 2 | -1 | 0 | 1 | 2 |
y | 15 | 1 | 1 | 3 | 19 |
A7)
Let the equation of second-degree polynomial be
x | y | Xy | ||||
-2 | 15 | -30 | 4 | 60 | -8 | 16 |
-1 | 1 | -1 | 1 | 1 | -1 | 1 |
0 | 1 | 0 | 0 | 0 | 0 | 0 |
1 | 3 | 3 | 1 | 3 | 1 | 1 |
2 | 19 | 38 | 4 | 76 | 8 | 16 |
x=0 | y=39 | xy=10 |
Normal equations are
On putting the values of x, y, xy, have
On solving (5), (6), (7), we get,
The required polynomial of second degree is
Q8) Fit a second-degree parabola to the following data.
X = 1.0 | 1.5 | 2.0 | 2.5 | 3.0 | 3.5 | 4.0 |
Y = 1.1 | 1.3 | 1.6 | 2.0 | 2.7 | 3.4 | 4.1 |
A8)
We shift the origin to (2.5, 0) antique 0.5 as the new unit. This amounts to changing the variable x to X, by the relation X = 2x – 5.
Let the parabola of fit be y = a + bXThe values of X etc. Are calculated as below:
x | X | y | Xy | ||||
1.0 | -3 | 1.1 | -3.3 | 9 | 9.9 | -27 | 81 |
1.5 | -2 | 1.3 | -2.6 | 4 | 5.2 | -5 | 16 |
2.0 | -1 | 1.6 | -1.6 | 1 | 1.6 | -1 | 1 |
2.5 | 0 | 2.0 | 0.0 | 0 | 0.0 | 0 | 0 |
3.0 | 1 | 2.7 | 2.7 | 1 | 2.7 | 1 | 1 |
3.5 | 2 | 3.4 | 6.8 | 4 | 13.6 | 8 | 16 |
4.0 | 3 | 4.1 | 12.3 | 9 | 36.9 | 27 | 81 |
Total | 0 | 16.2 | 14.3 | 28 | 69.9 | 0 | 196 |
The normal equations are
7a + 28c =16.2; 28b =14.3; 28a +196c=69.9
Solving these as simultaneous equations we get
Replacing X bye 2x – 5 in the above equation we get
Which simplifies to y =
This is the required parabola of the best fit.
Q9) Create least square regression line of set of points
A9)
Here is number of data points.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The simple linear regression is given by
Where
Here which is straight line.
Q10) Find the linear square regression for the following data. Also find y when
X | 0 | 1 | 2 | 3 | 4 |
Y | 1 | 3 | 5 | 4 | 6 |
A10)
Here, number of data given.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The simple linear regression is given by
Where
And
Hence the straight line is given by
Also
Q11) What do you understand by linear multiple regression?
A11)
Let Y depends on two independent variables X1 and X2,
Then the linear multiple regression problem is to fit the regression plane given by Equation (1) to a
Given set of N triples.
To estimate the coefficient 0, 1, 2, apply the least squares method to minimize
This results in three normal equations given by
Here b0, b1, b2 are the least squares estimates of 0, 1, 2.
Q12) What is the Lagrange’s interpolation formula?
A12)
Let , be defined function we get
X | ….. | ||||
f(x) | …… |
Where the interval is not necessarily equal. We assume f(x) is a polynomial of degree n. Then Lagrange’s interpolation formula is given by
Q13) By means of Lagrange’s formula, prove that
A13)
We construct the table:
X | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
Y=f(x) |
Here x = 3, f(x)=?
By Lagrange’s formula for interpolation
Hence proved.
Q14) find the polynomial of fifth degree from the following data
X | 0 | 1 | 3 | 5 | 6 | 9 |
Y=f(x) | -18 | 0 | 0 | -248 | 0 | 13104 |
A14)
Here
We get
By Lagrange’s interpolation formula
Q15) What do you understand by interpolation?
A15)
Interpolation is a technique of estimating the value of a function for any intermediate value of the independent variable while the process of computing the value of the function outside the given range is called extrapolation.
Let be a function of x.
The table given below gives corresponding values of y for different values of x.
X | …. | ||||
y= f(x) | …. |
The process of finding the values of y corresponding to any value of x which lies between is called interpolation.
If the given function is a polynomial, it is polynomial interpolation and given function is known as interpolating polynomial.
Conditions for Interpolation
1) The function must be a polynomial of independent variable.
2) The function should be either increasing or decreasing function.
3) The value of the function should be increase or decrease uniformly.
Q16) Using Newton’s forward difference formula, find the sum
A16)
Putting
It follows that
Since is a fourth-degree polynomial in n.
Further,
By Newton Forward Difference Method
Q17) Given find , by using Newton forward interpolation method.
A17)
Let , then
0.7071 | 0.7660 | - | 0.8192 | 0.8660 |
The table of forward finite difference is given below:
45
50
55
60 | 0.7071
0.7660
0.8192
0.8660 |
0.0589
0.0532
0.0468 |
-0.0057
-0.0064 |
-0.0007 |
By Newton forward difference method
Here initial value = 45, difference of interval h = 5 and the value to be calculated at x=52.
By Formula
Q18) Find from the following table:
0.20 | 0.22 | 0.24 | 0.26 | 0.28 | 0.30 | |
1.6596 | 1.6698 | 1.6804 | 1.6912 | 1.7024 | 1.7139 |
A18)
Consider the backward difference method
0.20
0.22
0.24
0.26
0.28
0.30 | 1.6596
1.6698
1.6804
1.6912
1.7024
1.7139 |
0.0102
0.0106
0.0108
0.0112
0.0115 |
0.0004
0.0002
0.0004
0.0003 |
-0.0002
0.0002
-0.0001 |
0.0004
-0.0003 |
-0.0007 |
Here
By Newton backward difference formula
Q19) The following are the marks obtained by 492 candidates in a certain examination
Marks | 0-40 | 40-45 | 45-50 | 50-55 | 55-60 | 60-65 |
No. of candidates | 210 | 43 | 54 | 74 | 32 | 79 |
Find out the number of candidates:
a) Who secured more than 48 but not more than 50 marks?
b) Who secured less than 48 but not less than 45 marks?
A19)
Consider the forward difference table given below:
Marks upto x | No. Of candidates y | |||||
40
45
50
55
60
65 | 210
210+43=253
253+54=307
307+74=381
381+32=413
413+79= 492 |
43
54
74
32
79 |
11
20
-42
47 |
9
-62
89 |
-71
151 |
222 |
Here
By Newton Forward Difference formula
f
a) No. Of candidate secured more than 48 but not more than 50 marks
b) No. Of candidate secured less than 48 but not less than 45 marks
Q20) Use the inverse interpolation to find value of x at for the following data:
X | 1 | 3 | 4 |
Y | 4 | 12 | 19 |
A20)
Here , we have the data
The Lagrange’s inverse interpolation formula is given by
.