Chapter IV

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

Chapter Four

Curve Fitting:

• Introduction,
• Least square Regression;
• Interpolations;
• Fourier Approximations

1
Introduction
• The process of finding the equation of the curve of best fit,
which may be most suitable for predicting the unknown
values, is known as curve fitting. Therefore, curve fitting
means an exact relationship between two variables by
algebraic equations. There are following methods for fitting a
curve:
I. Graphic method
II. Method of group averages
III. Method of moments
IV. Principle of least square.
• Out of above four methods, we will only discuss and study
here principle of least square

2
Least square Regression;
• The method of least square is probably the most systematic procedure to fit a
unique curve through the given data points.

3
Least square Regression;
• be fitted to the set of n data points ( ), ( ), ( ),….. ( ). At (x = ) the observed
(or experimental) value of the ordinate is and the corresponding value on
the fitting curve (i ) is a + b + c +…k = which is the expected or calculated
value. The difference of the observed and the expected value is = (say) this
difference is called error at (x = ) clearly some of the error , , ’…. will be
positive and other negative. To make all errors positive we square each of
the errors i.e., S = + + + ….. +…. the curve of best fit is that for which e’s
are as small as possible i.e. S, the sum of the square of the errors is a
minimum this is known as the principle of least square.

4
Least square Regression;
Fitting of Straight Line
• Let a straight line y= a + bx ...(1)
• Which is fitted to the given date points ( ), ( ), ( ),….. ( )
• Let be the theoretical value for then

5
Least square Regression;
The equation ( 3) and ( 4) are known as normal equations.
On solving equations ( 3) and ( 4) , we get the value of a and b. Putting the value
of a and b in equation ( 1) , we get the equation of the line of best fit.
Fitting of Parabola
• Let a straight line y= a + bx + c...(1)
• Which is fitted to the given date points ( ), ( ), ( ),….. ( )
• Let be the theoretical value for then

y= a + bx + c
Normal equation are = + +
=
= +b + =a+b +
=a + + c
6
The equation, (3), (4) and (5) are known as normal equations.
On solving equations (3), (4) and (5), we get the value of a, b and c. Putting the
value of a, b and c in equation (1), we get the equation of the parabola of best fit.
7
Example 1. Find the best-fit values of a and b so that y = a + bx fits the data given
in the table.

8
Putting these values in normal equations we get,
16.9 = 5a +b10
47.1 = 10a+ b30
On solving these two equations we get, a =0.72, b = 1.33.
So required line y = 0.72 + 1.33x.

Example 2 . Fit a straight line to the given data regarding x as the


independent variable

9
Putting all values in the equations (2 ) and (3), we get
3060 = 6a + b21
6450 = 21a + 91b
Solving these equations, we get
a = 1361.97 and b = −243.42
hence the fitted equation is y = 1361.97 – 243.42x.
Example 3 . Fit a second-degree parabola to the following data
taking x as the independent variable.

11
(1 ) and solving the equations for a, b, and c; we get
a = −0.923; b = 3.520; c = −0.267.
Hence the fitted equation is y= −0.923 + 3.53x − 0.267 2x.
12
Interpolations;

Interpolation is the method of estimating unknown values with the help of


given set of observations. According to Theile Interpolation is, “The art of
reading between the lines of the table”. Also interpolation means insertion or
filling up intermediate terms of the series. It is the technique of obtaining the
value of a function for any intermediate values of the independent variables
i.e., of argument when the values of the function corresponding to number of
values of argument are
given. The process of computing the value of function outside the range of
given values of the variable is called extrapolation

13
Interpolations;

There are three methods to interpolate the certain quantity.


1) Graphical Method :According the Graphical Method, take a suitable
scale for the values of x and y i.e., for arguments and entries values, and
plot the different points on the Graph for these values of x and y. Draw
the Curve passes through the different plotted points and find a point on
the curve corresponding to argument x and obtain the corresponding
entry value y. This method is not reliable most of the cases.
2) Method of Curve Fitting : This method can be used only in those cases
in which the form of the function in known. This method is not exact
and becomes more complicated when the number of observations is
sufficiently large. The only merit of this method lies in the fact that it
gives closer approximation than the graphical method. 14
Interpolations;

3) Use of the Calculus of Finite Difference: The study of finite differences


for the purpose of interpolation can be divided into three parts.
(a) The technique of interpolation with equal intervals.
(b) The technique of interpolation with unequal intervals.
(c) The technique of central differences
NEWTON’S GREGORY FORMULA FOR FORWARD
INTERPOLATION

15
Interpolations;

Newton’s Gregory Formula For Forward Interpolation

16
Interpolations;

Newton’s Gregory Formula For Forward Interpolation

17
Interpolations;

Newton’s Gregory Formula For Forward Interpolation

18
Interpolations;

Newton’s Gregory Formula For Forward Interpolation


which is required formula for forward interpolation. This formula is useful
for interpolating the values of f(x) near the starting of the set of values
given. h is called interval of differencing while ∆ is forward difference
operator. This is applicable for equally spaced argument only.
Example The following table gives the distance in nautical miles of the
visible horizon for the given heights in feet above the earth’s surface.

Use Newton’s forward formula to find y when x = 218 ft

19
Interpolations;

20
Interpolations;

21
Fourier approximation

Introduction
One important application of linear algebra is in the representation
and approximation of functions. For example, suppose E(t) is a
function that represents the amount of acoustical energy received
by a microphone at time t. Since sound energy is in the form of
sound waves of varying frequencies, it seems plausible to represent
E(t) as a linear combination of simple waves. In mathematics,
simple waves are represented using sine and cosine functions of the
form sin(kt) and cos(kt), where k is a nonnegative integer, and the
greater the k value, the higher the wave frequency. Then

where . . . , , , . . . , are constant coefficients, and n is a nonnegative


integer that is sufficiently large enough to capture all of the
frequencies that comprise E(t).
22
Fourier approximation

The expression on the right is called a trigonometric polynomial


of order n (assuming ≠ 0 and 0). A trigonometric polynomial
representation of E(t) seems quite useful, since it allows one to
determine the dominant acoustical frequencies that comprise the
energy function. These frequencies will correspond with values of k
for which either or seems substantial. But how to determine the
values of these coefficients?
Recall that the span of the set of wave functions

23
Fourier approximation

Fourier sine series S(x) = sin x + sin 2x + sin 3x + ··· (1)


If the numbers , ,... drop off quickly enough (we are foreshadowing the
importance of the decay rate) then the sum S(x) will inherit all three
properties:
Periodic S(x + 2π) = S(x) Odd S(−x) = −S(x) S(0) = S(π)=0

24

You might also like