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

Numerical Methodes - Chapter 4

This document discusses curve fitting using different regression methods: 1. Linear regression fits a straight line to data points by minimizing the sum of squared residuals, using the method of least squares to determine the line's slope and y-intercept. 2. Quadratic regression fits a parabolic curve to data points by minimizing residuals, determining the coefficients of a second-degree polynomial curve of best fit. 3. Examples are provided to illustrate linear regression, estimating values, and transforming data to fit a line. The key steps of linear regression using the method of least squares are explained.

Uploaded by

Eyuel Bini
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)
94 views25 pages

Numerical Methodes - Chapter 4

This document discusses curve fitting using different regression methods: 1. Linear regression fits a straight line to data points by minimizing the sum of squared residuals, using the method of least squares to determine the line's slope and y-intercept. 2. Quadratic regression fits a parabolic curve to data points by minimizing residuals, determining the coefficients of a second-degree polynomial curve of best fit. 3. Examples are provided to illustrate linear regression, estimating values, and transforming data to fit a line. The key steps of linear regression using the method of least squares are explained.

Uploaded by

Eyuel Bini
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

CHAPTER IV

4.Curve Fitting
4.1 Introduction
Fitting of curves to a set of numerical data is of
considerable importance- theoretical as well as practical. Theoretically it
is useful in the study of correlation and regression. In practice it enables
us to represent the relationship between two variables by simple
algebraic expressions (polynomials, exponential, or logarithmic functions
or any). Moreover, it may be used to estimate the values of one variable
which would correspond to the specified values of the other variable(s).

This chapter covers how to fit a curve for a given set of data points using
different methods. We will focus on the points of

Regression

- linear regression

- quadratic regression

- polynomial regression

- multiple regression

1
In most of the fields of engineering and science, we

come across experiments which involve many variables, and most of the

time data is collected or given for discrete values along a continuum; the

relation between these variables can be discussed so easily and for many of

these variables it is very difficult to identify the relation unless we can

model the system mathematically. When the system is explained in terms

of mathematical models we have the following relationships about the

variables:

1. The relationship between these variables is given in terms of

mathematical rules, formulae if any, to determine the

quantities of these variables. Actually it is simple to use these

rules for application.

2. The quantities/ variables are given so that we will be interested in

finding the relationships between these variables. This process is a

little bit difficult because to write one variable in terms of the other

variables (called empirical equation). Most of the time we may not

be able to get an exact relation between these variables and we may

get only an approximate relation or curve.

This approximating curve is an empirical equation and the method of

finding such an approximating curve is called curve fitting.

2
Suppose (xi , y i ) , i = 1,2,3,..., n be n sets of observations and the

law relating x and y can be determined by different mathematical systems

that clearly explains the relationship between these sets of n observations

(xi , yi ) . Actually, here we may have different approaches to fit the given

data, and one system may approximate better than the other system on

the same given set of data points.

Now we will see some of these different approaches:

4.2 Least square Regression

4.2.1. LINEAR REGRESSION

Suppose that the relationship is given

y i = a + bxi , i = 1, 2,3,..., n … (1)

Equation (1) represents a family of straight lines for different values of

the arbitrary constants ' a ' and ' b '. The problem now is to determine ' a '

and ' b ' so that the line (1) is the line of "best fit". The term best fit is

interpreted in accordance with the Legendre's principle of least squares

which consists of the deviations of the actual values as given by the line

of best fit. As a matter of chance all the points may lie on a straight line

and in this case the line is a 'perfect fit' and the sum of the squares of

the deviations is zero.

3
Let Pi ( xi , y i ) be any point in the scatter diagram. Draw

Pi M perpendicular to the x-axis meeting the line y = a + bx in H i . The

coordinates of H i are ( xi , a + bxi ) .

Pi H i = Pi M − H i M
= y i − (a + bxi )

PiHi is called the error of estimates or the residual for yi .

According to the principle of least squares, we have to determine a and b

so that

n n
E = ∑ Pi H i = ∑ ( y i − a − bxi ) 2 is the minimum.
2

i =1 i =1

Using the principle of maxima and minima what we have studied in

calculus, the partial derivatives of E with respect to a and b should

vanish separately.

∂E n
That is, = −2∑ ( yi − a − bxi ) = 0
∂a i =1

n n n
⇒ ∑ y = ∑ a + b∑ x
i =1
i
i =1 i =1
i

n
= na + b ∑ xi (i )
i =1

4
and

∂E n
= −2∑ xi ( y i − a − bxi ) = 0
∂b i =1
. n n n
⇒ ∑ x i y i = a ∑ x i + b ∑ xi
2
(ii )
i =1 i =1 i =1

Equations (i) and (ii) are called normal equations.

Solving for a and b from (i) and (ii), we get the values of a and b , and

with these values of a and b so obtained, equation (1) is the line of best

fit to the given set of points (xi , yi ) , i = 1,2,3,..., n .

Now let us see some examples to illustrate the above discussion.

Example 1. By the method of least squares find the best fitting

straight line to the data given below:

x: 5 10 15 20 25

y: 15 19 23 26 30

Solution

Let the line of best be y = a + bx

The normal equations are

n n

∑ y i = 5a + b ∑ x i
i =1 i =1

n n n

∑ xi yi = a ∑ xi + b∑ xi
i =1 i =1 i =1
2

5
We calculate ∑ x, ∑ y, ∑ x , ∑ xy
2
and form the table below

x y x2 xy

5 15 25 75
10 19 100 190
15 23 225 345
20 26 400 520
25 30 625 750
75 114 1375 1885
Using these values in the normal equations, we get

5a + 75b = 114
75a + 1375b = 1885

Solving for a and b we get a=12.3 and b=0.7 and thus the line of best fit

is y = 12.3 + 0.7 x

Example 2. Find the best fitting straight line to the data given below

by the method of least squares and also estimate y when

x is 70.

x: 71 68 73 69 67 65 66 67

y: 69 72 70 70 68 67 68 64

Solution

First transform the values of x and y to X = x − 68 and Y = y − 70

and the normal equations are

b ∑ X + 8a = ∑ Y
b∑ X 2 + a ∑ X = ∑ XY

6
Calculations:

x y X Y X2 XY

71 69 3 -1 9 -3

68 72 0 2 0 0

73 70 5 0 25 0

69 70 1 0 1 0

67 68 -1 -2 1 2

65 67 -3 -3 9 9

66 68 -2 -2 4 4

67 64 -1 -6 1 6

2 -12 50 18

Substituting these values in the normal equations, we get

2b + 8a = −12
50b + 2a = 18

35 16
Solving for a and b , we get b = and a =
99 99

35 16
Thus the line of best fit is of the form Y = X+
99 99

35 16
This implies y − 70 = ( x − 68) +
99 99

35 4566
y= x+
99 99

When x = 70 ⇒ y = 70.87

7
4.2.2 QUADRATIC REGRESSION

(FITTING OF SECOND DEGREE PARABOLA)

Let y = a + bx + cx 2 be the second degree parabola of best fit to set of n

points (xi , y i ) , i = 1,2,3,..., n .

Using the principle of least squares, we have to determine a , b, and c

so that E = ∑ (yi − a − bxi − cx )


n 2
2
i is minimum
i =1

Equating to zero the partial derivatives of E with respect to a , b, and c

separately, we get the normal equations for estimating a , b, and c as

∂E
( )
n
= −2∑ yi − a − bxi − cxi2 = 0
∂a i =1

n n n
⇒ ∑ yi = na + b∑ xi + c ∑ xi2 …………………. (1)
i =1 i =1 i =1

∂E
( )
n
= −2∑ yi − a − bxi − cxi2 xi = 0
∂b i =1

n n n n
⇒ ∑ xi yi = a ∑ xi + b ∑ xi2 + c ∑ xi3 ........................( 2)
i =1 i =1 i =1 i =1

∂E
( )
n
= −2∑ yi − a − bxi − cxi2 xi2 = 0
∂c i =1

n n n n
⇒ ∑ xi2 yi = a ∑ xi2 + b∑ xi3 + c ∑ xi4 .......................(3)
i =1 i =1 i =1 i =1

Solving for a , b, and c from (1), (2) and (3), we get with these values of

a , b, and c the parabola of best fit.

8
Example 1 Fit a parabola of second degree to the following data

X: 0 1 2 3 4

Y: 1 1.8 1.3 2.5 6.3

Solution

X Y X2 X3 X4 XY X2Y

0 1 0 0 0 0 0

1 1.8 1 1 1 1.8 1.8

2 1.3 4 8 16 2.6 5.2

3 2.5 9 27 81 7.5 22.5

4 6.3 16 64 256 25.2 100.8

10 12.9 30 100 354 37.1 130.3

Substituting these values in the normal equations, we get

12.9 = 5a + 10b + 30c


37.1 = 10a + 30b + 100c
130.3 = 30a + 100b + 354c

Solving for a , b, and c , we get

a = 1.42, b = −1.07 , and c = 0.55

∴ y = 1.42 − 1 − 07 x + 0.55 x 2 is the best fit.

Exercise Find the best fitting parabola to the data given below by the

method of least squares and also estimate y when x is 70.

x: 71 68 73 69 67 65 66 67

y: 69 72 70 70 68 67 68 64

9
4.2.3 POLYNOMIAL REGRESSION
FITTING OF A POLYNOMIAL OF KTH DEGREE

If y = a 0 + a1 x + a 2 x 2 + ... + a k x k is the kth degree polynomial of best fit to the

set of points (xi , y i ) ; i = 1,2,3,..., n the constants a 0 , a1 , a 2 , ... , a n are to be

obtained so that

( )
n
E = ∑ yi − a0 − a1 xi − a2 xi2 ...ak xik
2
is minimum.
i =1

Thus the normal equations for estimating a 0 , a1 , a 2 , ... , a n are obtained on

equating to zero the partial derivatives of E with respect to a 0 , a1 , a 2 , ... , a n

separately.

∂E
= 0 ⇒ ∑ yi = na0 + a1 ∑ xi + a2 ∑ xi2 + ... + ak ∑ xik
∂a0

∂E n
= 0 ⇒ ∑ xi yi = a0 ∑ xi + a1 ∑ xi2 + ... + ak ∑ x k +1
∂a1 i =1

∂E n
= 0 ⇒ ∑ xik yi =a0 ∑ xik + a1 ∑ xik +1 + ... + ak ∑ xi2 k
∂ak i =1

Exercise Find the polynomial of degree three that best fits the data

given below by the method of least squares and also

estimate y when x is 70.

x: 71 68 73 69 67 65 66 67

y: 69 72 70 70 68 67 68 64

10
4.2.4. MULTIPLE REGRESSION

There are different multiple regression forms. For the sake of discussion

let us see the following regression type.

Suppose we want to fit the set of data points by the relation

Z = ax + bxy + cy , here we need the points to be of the form ( xi , y i , z i ) .

We determine the values of a ,b, and c , from

n
E = ∑ ( zi − axi − bxi yi − cyi )
2

i =1

∂E n
= −2∑ ( zi − axi − bxi yi − cyi )xi = 0
∂a i =1

n n
⇒ ∑ xi zi = a ∑ xi2 + b ∑ xi2 yi + c∑ xi yi ..............................(1)
i =1 i =1

∂E n
= −2∑ ( zi − axi − bxi yi − cyi )xi yi
∂b i =1

n n n n
⇒ ∑ zi xi yi = a ∑ xi2 yi + b∑ xi2 yi2 + c ∑ xi yi2 ..............................( 2)
i =1 i =1 i =1 i =1

∂E n
= −2∑ ( zi − axi − bxi yi − cyi )yi
∂b i =1

n n n n
⇒ ∑ zi yi = a ∑ xi yi + b∑ xi yi2 + c ∑ yi2 ..............................(3)
i =1 i =1 i =1 i =1

By solving (1), (2) and (3) for a ,b, and c , we get the best approximation.

11
4.3 INTERPOLATION

In this chapter we mainly focus on the polynomial approximations of


functions for a given set of data points. To do this we have different
methods and we will try to look on

-Newton’s interpolation formula for unequal intervals


(Newton’s divided difference formula)
-Lagrange’s interpolation formula
-Spline interpolation

12
f ( x, x0 , x1 ) − f ( x0 , x1 , x2 )
f ( x, x0 , x1 , x2 ) =
x − x2

∴ f ( x, x0 , x1 ) = f ( x0 , x1 , x2 ) + ( x − x2 ) f ( x, x0 , x1 , x2 )

⇒ f ( x ) = f ( x0 ) + ( x − x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1 , x2 ) +
(x − x0 )(x − x1 )(x − x2 ) f (x, x0 , x1 , x2 )
Continuing in this fashion, we get

f ( x ) = f ( x 0 ) + (x − x 0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x 0 , x1 , x 2 ) + ... +
(x − x0 )(x − x1 )...(x − x n ) f (x, x0 , x1 , x 2 ,..., x n ).................................(∗)

Now, if f ( x ) is a polynomial of degree n, then f ( x, x0 , x1 ,..., xn ) = 0

Hence, the last equation (*) becomes,

f ( x ) = f ( x 0 ) + ( x + x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1 , x 2 ) + ... +
(x − x0 )(x − x1 )...(x − x n−1 ) f (x0 , x1 , x2 ,..., xn )
This equation is called Newton’s divided difference interpolation formula for

unequal intervals.

From this discussion we can deduce Newton-Gregory interpolation forward

formula for equal intervals.

For, Since f ( x 0 , x1 , x 2 ,..., x n ) = ∆n f (x 0 ) and if x − x0 = uh


1
n
n! h

then x − x1 = ( x − x0 ) − ( xi − x0 ) = uh − h = (u − 1)h

x − x2 = ( x − x0 ) − ( x2 − x0 ) = uh − 2h = (u − 2 )h,...

uh∆f ( x0 ) uh(u − 1)h 2


f (x ) = f (x0 ) + + ∆ f ( x0 ) + ...
h 2!h 2

Let y 0 = f ( x0 )

13
u (u − 1) 2
∴ f ( x ) = y 0 + u ∆y 0 + ∆ f ( x0 ) + ... this is exactly Newton’s Gregory forward
2!

interpolation formula for equal intervals.

Examples

1. Using Newton’s divided difference formula, find the values of f ( 2) , f (8)

and f (15) given the following

x: 4 5 7 10 11 13

f ( x) : 48 100 294 900 1210 2028

Solution

x f ( x) ∆f ( x ) ∆2 f ( x ) ∆3 f ( x ) ∆4 f ( x )

4 48
52
15
5 100
97 1
7 294 21
202 0
1
10 900 27
310 0
33 1
11 1210
409
13 2028

By Newton’s divided difference interpolation formula

f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 − x1 ) + ( x − x 0 )( x − x1 ) f ( x0 , x1 , x 2 ) + ... +

(x − x0 )(x − x1 )(x − x2 )...(x − xn ) f (x0 , x1 , x2 ,..., xn +1 ) + ...

f ( x ) = 48 + (x − 4)(52) + ( x − 4)( x − 5)(15) + ( x − 4)( x − 5)( x − 7 )(1)

= 48 + 52 x − 208 + 15 x 2 − 135 x + 300 + x 3 − 16 x 2 + 83 x − 140

= x3 − x 2 and so f ( 2) = 4 , f (8) = 64(8 − 1) = 448 and f (15) = 3150

14
2. From the following table find f ( x ) and hence f (12) using Newton’s

interpolation formula.

x: 1 2 7 8

f ( x) : 1 5 5 4

Solution

x f ( x) ∆f ( x ) ∆2 f ( x ) ∆3 f ( x ) ∆4 f ( x )

1 1
4 4
2 5 −
0 6 1
7 5 1 14

-1 6
8 4

f ( x ) = f ( x0 ) + ( x − x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1 , x2 ) + (x − x0 )( x − x1 )( x − x2 ) f ( x0 , x1 , x2 , x3 )

= 1 + ( x − 1)(4) + ( x − 1)( x − 2) − 2 ( 3 )+ (x − 1)(x − 2)(x − 7) 141 


=
1
42
(3 x3 − 58 x 2 + 321x − 224)

∴ f (12 ) = 10.95238095

3. Find the function f from the following table and find f(3)

x: 0 1 2 4 5 7

f ( x) : 0 0 -12 0 600 7308

Solution

Since f (0) = 0, f (1) = 0 and f ( 4) = 0 we have x( x − 1)(x − 4) is a factor of f ( x ) .

So let f ( x ) = x( x − 1)( x − 4)φ (x )

15
f (x )
⇒ φ (x ) =
x( x − 1)( x − 4 )

− 12
Now φ (2 ) = =3
2(2 − 1)(2 − 4 )

f (5) f (7 )
φ (5) = and φ (7 ) =
600
= = 30 = 58
5(4 )(1) 20 7(6 )(3)

Now we find φ ( x ) using divided difference formula

x φ (x ) ∆f ( x ) ∆2 f ( x )

2 3
9
5 30 1
14
7 58

∴ φ ( x ) = φ (2) + (x − 2)(9) + ( x − 2)( x − 5)

= 3 + 9 x − 18 + x 2 − 7 x + 10 = x 2 + 2 x − 5

Hence, f ( x ) = x( x − 1)( x − 4 )( x 2 + 2 x − 5)

4. From the table, obtain f ( x ) as a polynomial in powers of ( x − 5) .

x: 0 2 3 4 7 9

f ( x) : 4 26 58 112 466 922

Solution

Look the table in the next page.

Since the third differences are constants, we extend the table by introducing

x = 5 three times and introducing unknowns from the last column.

16
x f ( x) ∆f ( x ) ∆2 f ( x ) ∆3 f ( x )

0 4
11
2 26 7
32 1
3 58 11
1
54
4 112 16
118 1
7 466 22
b − 22
228 =1
p − 228 1
9 922 =b
a − 922 −2
= p d −b
5 a −4
q− p 5−7
=d
5 q 5−9
k −d
k =1
5 5−9

Thus from the table we have the following

b − 22 p − 228
= 1 ⇒ b = 23 = 23 ⇒ p = 182
1 −2

a − 922
= 182 ⇒ a = 194
−4

d −b q− p
= 1 ⇒ d = 21, = 21 ⇒ q = 98
−2 −4

k −d
= 1 ⇒ k = 17
−4

Now

f ( x ) = f (5) + ( x − 5) f (x0 , x1 ) + ( x − 5)( x − 5) f ( x0 , x1 , x2 ) + ( x − 5) f ( x0 , x1 , x2 , x3 )


3

= a + ( x − 5)q + ( x − 5) k + ( x − 5)
2 3

= 194 + 98( x − 5) + 17( x − 5) 2 + ( x − 5)


3

17
5. Using the following table, find f ( x ) as a polynomial in power of ( x − 6) .

Also find f (5) .

x: -1 0 2 3 7 10

f ( x ) : -11 1 1 1 141 561

Solution

Since the third differences are constants we extend the table by introducing

x = 6 three times and introducing unknowns from the last column.

x f ( x) ∆f ( x ) ∆2 f ( x ) ∆3 f ( x ) ∆4 f ( x )

-1 -11
12
0 1 -4
1
0
2 1 0 0
0 1
3 1 7 0
35 1
7 141 15
140 q − 15
p − 140 =1
10 561 =q 3
a − 561 −1
= p r−q
6 a −4 =1
b− p −1
=r
6 b −4
c−r
6 c =1
−4

q − 15 p − 140
= 1 ⇒ q = 18 = 18 ⇒ p = 122
3 −1

a − 561
= 122 ⇒ a = 73
−4

r−q
= 1 ⇒ r = 17
−4

18
b− p
= r ⇒ b = 122 − 4(17 ) = 54
−4

c−r
= 1 ⇒ c = 17 − 4 = 13
−4

Now f ( x) = 73 + ( x − 6)(54) + ( x − 6) 2 (13) + ( x − 6) 3 (1)

Thus, f (5) = 31 .

4.3.2 LaGrange’s interpolation formula (for unequal intervals)

The forward and backward interpolation formulae of

Newton can be used only when the values of independent variable x are

equally spaced. Further, the differences must become ultimately small. In

cases where the values of independent variable are not equally spaced and in

cases when the differences of dependent variable are not small, ultimately, we

will use Lagrange’s interpolation formula.

Let y = f ( x ) be a function such that f ( x ) takes the values

y 0 , y1 , y 2 , y 3 ,..., y n corresponding to x0 , x1 , x 2 , x3 ,..., x n . That is, y i = f ( xi ), i = 0,1,2,..., n .

Now, there are ( n + 1) paired values ( xi , y i ), i = 0,1,2,..., n and hence f ( x ) can be

represented by a polynomial function of degree n in x .

Now choose f ( x ) such that

f ( x) = a 0 ( x − x1 )( x − x 2 )...( x − x n ) + a1 ( x − x0 )( x − x 2 )( x − x3 )...( x − x n ) +
a 2 ( x − x0 )( x − x1 )( x − x3 )...( x − x n ) + ... + a i ( x − x 0 )( x − x1 )...( x − xi )( x − xi +1 )...( x − x n )
+ ... + a n ( x − x0 )( x − x1 )( x − x 2 )...( x − x n −1 ) ..........(1)

Note that the term in which a i occurs has no the factor ( x − xi ) .

19
The main point now what it remains is to decide the value of a i ' s .

Substituting in (1) x = x0 , y = y 0 , we have

y 0 = a 0 ( x0 − x1 )( x0 − x 2 )...( x0 − x n )

y0
∴ a0 =
( x0 − x1 )( x 0 − x 2 )...( x0 − x n )

Similarly, setting x = x1 , y = y1 , we get

y1 = a1 ( x1 − x0 )( x1 − x 2 )...( x1 − x n )

y1
∴ a1 =
( x1 − x0 )( x1 − x 2 )...( x1 − x n )

In the same way we get,

y2
∴ a2 =
( x 2 − x0 )( x 2 − x1 )( x 2 − x3 )...( x 2 − x n )

……..

yn
∴ an =
( x n − x0 )( x n − x1 )...( x n − x n −1 )

Substituting these values of a ’s in (1), we have

( x − x1 )( x − x 2 )...( x − x n ) ( x − x0 )( x − x 2 )( x − x3 )...( x − x n )
f ( x) = y0 + y1 +
( x0 − x1 )( x 0 − x 2 )...( x0 − x n ) ( x1 − x0 )( x1 − x 2 )...( x1 − x n )
( x − x0 )( x − x1 )( x − x3 )...( x − x n ) ( x − x0 )( x − x1 )( x − x 2 )...( x − x n −1 )
y 2 + ... + y n .....(2)
( x 2 − x0 )( x 2 − x1 )( x 2 − x3 )...( x 2 − x n ) ( x n − x0 )( x n − x1 )( x n − x 2 )...( x n − x n −1 )

Equation (2) is called Lagrange’s interpolation formula for unequal intervals.

20
Examples

1. Using Lagrange’s interpolation formula, find y (8) from the following table

x: 5 6 9 11

y: 12 13 14 16

Solution

( x − 6)( x − 9)( x − 11) ( x − 5)( x − 9)( x − 11) ( x − 5)( x − 6)( x − 11)


y = f ( x) = (12) + (13) + (14) +
(5 − 6)(5 − 9)(5 − 11) (6 − 5)(6 − 9)(6 − 11) (9 − 5)(9 − 6)(9 − 11)
(x - 5)(x - 6)(x - 9)
(16)
(11 − 5)(11 − 6)(11 − 9)

y (8) = 13.7

2. Find the parabola that passes through the points (1,2), (3,12), (6,30).

Solution

Using Lagrange’s interpolating formula, we have

( x − 3)( x − 6) ( x − 1)( x − 6) ( x − 1)( x − 3)


y = f ( x) = ( 2) + (12) + (30)
(1 − 3)(1 − 6) (3 − 1)(3 − 6) (6 − 1)(6 − 3)

1 2
y= ( x + 21x − 12)
5

3. The mode of a certain frequency curve y = f ( x ) is very nearer to x = 9 and

the values of the frequency density f ( x ) for x = 8.9, 9, and 9.3 are

respectively 0.30, 0.35, and 0.25. Calculate the approximate value of the

mode.

Solution

We have the following table


x: 8.9 9 9.3
y: 0.30 0.35 0.25

21
By Lagrange’s interpolating formula, we have

( x − 9)( x − 9.3) ( x − 8.9)( x − 9.3) ( x − 8.9)( x − 9)


y = f ( x) = (0.30) + (0.35) + (0.25)
(8.9 − 9)(8.9 − 9.3) (9 − 8.9)(9 − 9.3) (9.3 − 8.9)(9.3 − 9)

1
y= ( −25 x 2 + 453.5 x − 2052.3)
12

To get the mode f ′( x ) = 0 and f ′′( x ) is negative

1
f ′( x ) = ( −50 x + 453.5) = 0
12

⇒ x = 9.07

50
f ′′( x) = − <0
12

Hence, f ( x ) is maximum at x = 9.07 and therefore the mode is 9.07.

So far, we were given the values of x and y , we tried to find the

corresponding value of y for some x . Now if we change the problem to find the

corresponding value of x for a given value of y ; this process of finding the value

of x given y is called the inverse interpolation.

The main point here is to interchange the dependent and independent variable

and we can proceed by applying one of the methods developed so far.

22
23
24
25

You might also like