You are on page 1of 22

LEAST SQUARE

APPROXIMATION/REGRESSION
Numerical Methods by Chapra(Chapter 17)
Numerical Analysis by Burden(Chapter 8)
 Fitting a Degree Polynomial
•Suppose
  we have to fit a degree polynomial

then we have to determine constants using least squares principle.


For that we have to solve the following system of linear equations
simultaneously.
For that, you can use techniques studied in “Linear Algebra”
• 

. . . .
. . . .
. . . .
Example 4:
• The following data shows the bacterial growth in a liquid culture over a number of
days. Fit a least square parabola to the above data.
Days 0 4 8 12 16 20
Amount 67 84 98 125 149 185
Exercises
Numerical Analysis by Burden
Exercise 8.1: Solve questions related to least square parabola and polynomials.
Numerical Methods by Chapra
Exercise 17: Solve questions related to least square parabola and polynomials.
INTERPOLATION
Numerical Methods by Chapra (Chapter 18)
Numerical Analysis by Burden (Chapter 3)
Interpolation
•  Interpolation is an approach in which estimated curve passes directly through
each of the points.

• Thus, For data points, there is one and only one polynomial of degree n that
passes through all the points.
Interpolation Formulae

Newton’s Divided
Lagrange Interpolation
Difference Interpolation
Formula
Formula

Newton’s Forward Newton’s Backward


Difference Interpolation Difference Interpolation
Formula For equally Formula For equally
Spaced Data Spaced Data

Stirling’s Central Difference


Interpolation Formula For
equally Spaced Data
Equally Spaced and Unequal Spaced Data
• 
• Equally spaced data: Values of independent variable are equally spaced. For
example if then

x 1 2 5 Unequal
y 1 4 10 Spaced Data

x 1 2 3 4 Equally
y 0 7 26 124 Spaced Data
Lagrange Interpolation Formula
• Lagrange
  Interpolation formula is applicable to equally spaced data as well as
unequal spaced data.
Development of Formula:
Let be a function which takes the values corresponding to . Since there are values of
corresponding to values of , we can represent by a polynomial of degree .

Let then first degree polynomial(straight line) for two sets of values is
• 
where
 Thus nth degree polynomial for for sets of data is
Example 1:
Find Lagrange Interpolation polynomial fitting the 1 3 4 6
points given in the following table. -3 0 30 132
Example 2
Evaluate
•  using Lagrange Interpolation x 1 2 5
formula.
y 1 4 10
Exercises
Numerical Analysis by Burden
Exercise 3.1: Solve questions related to Lagrange Interpolation Polynomial.
Numerical Methods by Chapra
Exercise 18: Solve questions related to Lagrange Interpolation Polynomial.

You might also like