CSE 541 Numerical Methods - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

CSE 541 Numerical Methods

Description:

For example least squares fitting. 8/2/09. 6. OSU/CSE 541. Interpolation. Assumptions: ... Least-squares. Error minimization. 8/2/09. 9. OSU/CSE 541. Polynomial ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 23
Provided by: rogerc2
Category:
Tags: cse | methods | numerical

less

Transcript and Presenter's Notes

Title: CSE 541 Numerical Methods


1
CSE 541Numerical Methods
  • Polynomial Interpolation
  • Lagrange and Newtons

2
Data Interpolation
  • Problem
  • Given A list of data points xi, fi
  • Goal Evaluate the function in between the xis
  • Solutions???
  • Nearest value
  • Average between neighboring values
  • Find a function that models or fits
    (approximates?) the data points
  • Local vs global information

3
Interpolation
  • Data from experimental/observational measurements
  • Classic gravity drop location changes with time
  • Pressure varies with depth
  • Wind speed varies with time
  • Temperature varies with location
  • Census data

What was the population at 1964?
  • The relationship looks linear
  • Global information (trends)

4
Science, Engineering, Statistics, etc.
  • Scientific method (Also Engineering)
  • Identify the underlying relationship in your data
    (patterns/trends)
  • Deal with noise in the data
  • Make predictions about the behavior of a process
  • Not extrapolation!
  • Remember distributions in statistics
  • Tools used in social science, political science,
    etc.

5
Regression vs Interpolation
  • Pretty confident
  • There is a polynomial relationship
  • Little/no scatter
  • Find an expression that passes exactly
  • through all the points
  • This function is an interpolant
  • Unsure about the relationship
  • Data looks scattered
  • Maybe noisy data?
  • Find an expression that captures the trend
  • Minimize some measure of the error
  • over all the points
  • For example least squares fitting

6
Interpolation
  • Assumptions
  • No error in the data
  • Round-off is assumed to be negligible
  • We dont know the underlying function f (x)
  • Given n1 points xi, fi, x0,x1xi,xn xj gt
    xj-1
  • Spacing may or may not be even
  • All xi are distinct
  • Interpolation
  • Develop a simple function g(x) that
  • Approximates f (x)
  • Passes through all the points xi (i.e., an
    interpolant)
  • Evaluate f (xt) where x0 lt xt lt xn

7
Taylors Series
  • Why not use a Taylor Series for interpolation?
  • Interpolates at the point of expansion c
  • Approximation gets worse further away from c
  • It may not interpolate at other points
  • Need f (c), f (c), f (c),
  • We would want an interpolant at several f (c)s

8
Modeling Choices
  • How do we choose the simple function g(x)???
  • Polynomials
  • Splines
  • Trigonometric functions (Data looks periodic)
  • Fourier Transform representations
  • Least-squares
  • Error minimization

9
Polynomial Interpolation
  • Why are polynomials nice functions?
  • Defines a line very easily (a linear
    relationship)
  • Easily definable derivatives

10
Existence Theorem
  • Wierstrass Approximation Theorem
  • Does not say how well the polynomial approximates
    a function
  • What degree polynomial do we use?
  • Weaker Theorem
  • ò f(x) p(x)dx lt e
  • But, we have existence of a polynomial

11
Existence and Uniqueness
  • Consider our data set of n 1 points yif(xi) at
    distinct points x0,x1xi,xn
  • In general, there is a unique polynomial
    interpolant gn(x) of at most degree n
  • What about uniqueness?
  • Assume uniqueness for now and well prove it later

12
Polynomial Interpolation
  • How do we find gn(x)?
  • Take n 3, so x0, y0, x1, y1, x2, y2, x3,
    y3
  • Just solve, right?
  • a0 a1x0 a2x02 a3x03 y0
  • a0 a1x1 a2x12 a3x13 y1
  • a0 a1x2 a2x22 a3x23 y2
  • a0 a1x3 a2x32 a3x33 y3
  • Express this as a matrix problem Ax b? Solve
    for A.
  • This may not be easy to solve if it is an
    ill-conditioned system
  • Large degree polynomials when n is large

13
Lagrange Polynomials
  • Construct a polynomial with the following form
  • A linear combination of the sample points

14
Constant Interpolation
  • Take n 0,

x0
15
Linear Interpolation
  • Take n 1

Blending functions
x0
x1
16
Lagrange Polynomials
  • Take n 2, quadratic polynomial
  • L0(x), L1(x), and L2(x)
  • The third quadratic has roots at x0 and x1 and a
    value equal to the function data at x2.
  • P(x0) 0
  • P(x1) 0
  • P(x2) f2
  • The first quadratic has roots at x1 and x2 and a
    value equal to the function data
  • at x0.
  • P(x0) f0
  • P(x1) 0
  • P(x2) 0
  • The second quadratic has roots at x0 and x2 and a
    value equal to the function data at x1.
  • P(x0) 0
  • P(x1) f1
  • P(x2) 0
  • Adding them all together, we get the
    interpolating quadratic polynomial, such that
  • P(x0) f0
  • P(x1) f1
  • P(x2) f2

x0
x2
x1
17
Newton Interpolation
  • Consider our data set of n 1 points yif (xi)
    at distinct points x0,x1xi,xn
  • Note, the notation for the divided difference is
    reverse from what is presented in the textbook

18
Interpolation
  • Constant interpolation
  • pn(x) f(x0)
  • Linear interpolation

x0
x1
slope
19
Quadratic Interpolation
  • Three data points

roots
Basis (support) for the interval
20
Newton Interpolation
We have a recursive definition
Divided Differences
21
Newton Interpolation
  • The recursion formula
  • The quadratic term

Divided Differences
22
Invariance Theorem
  • The order of the data points does not matter
  • Though, the data points must be distinct
  • Hence, the divided difference f x0, x1, , xk
    is invariant under all permutations of the xis
Write a Comment
User Comments (0)
About PowerShow.com