Chapter-5 Curve Fitting
Chapter-5 Curve Fitting
Chapter-5 Curve Fitting
CURVE FITTING
1. Introduction
Curve Fitting- The process of approximating
function values.
TECHNIQUES- REGRESSION and
INTERPOLATION
REGRESSION- the process of finding another
curve that would closely match the target functions
values
INTERPOLATION- the process of approximating
points on a given function by using existent data
found in the neighborhood of these points.
2. Least Squares Regression
Fitting a straight line to a set of observations:
(x1, y1), (x2, y2),…, (xn, yn)
Mathematically:
y=ao+a1x+e
ao, a1 --- Coefficients
e --- Error/Residual
Objectives: calculating ao, a1, e
2. Least Squares Regression
2. Least Squares Regression
Minimization of the square of the residuals
2. Least Squares Regression
Rearranging
Power Functions
By setting x=x0.
SECOND ORDER:
THIRD ORDER:
Interpolation
[EXAMPLE] General form of Newton’s
Interpolating polynomial
Evaluate ln(2) using a third order divided
difference
polynomial
X0=0, f(0) = 0
X1=4, f(4) = 1.386294
X2=6, f(6) = 1.791759
X3=5, f(5) = 1.609438
Interpolation
Third order polynomial
Thus
Interpolation
Lagrange polynomials
A direct reformulation of Newton’s divided
difference polynomials[READING
ASSIGNMENT]
Avoid the computation of divided differences
Interpolation
[EXAMPLE]: Lagrange Interpolating Polynomials
First Order
Second Order
SPLINES
Splines
Curves that approximate functions using low order
polynomials fitted between consecutive sets of data
points.
Depending on the problem, splines can be superior
in accuracy than interpolating polynomials
Splines
Splines
First Order/Linear Splines
Where
Splines
[EXAMPLE] First Order Splines
Fit first order splines for the following data and
compute the value at x=5
Splines
[EXAMPLE] First Order Splines
Between x=4.5 and x=7, m= (2.5-1/7.0-4.5)=0.6
f(5)=1+0.6*(5-4.5)=1.3
Splines
Limitations
Abrupt Changes in slope
Discontinuity in evaluating derivatives
QUADRATIC SPLINES
Second order equations
QUADRATIC SPLINES
(1)
(2)
(3)
(4)
QUADRATIC SPLINES
[EXAMPLE]: Fit quadratic splines for the
following data
QUADRATIC SPLINES
Condition 1: Function values at interior points
connecting polynomials are equal.
Condition 4: a1 = 0
These equations result in a linear system of eight
equations and eight unknowns(b1, c1, a2, b2, c2,
a3, b3, c3).
QUADRATIC SPLINES
QUADRATIC SPLINES
Solving the system yields:
Finally:
Any Questions ?