Polynomial approximation and Splines

Similar documents
1 GSW Gaussian Elimination

15. Eigenvalues, Eigenvectors

Approximation of Continuous Functions

DIFFERENTIAL EQUATIONS First Order Differential Equations. Paul Dawkins

Triple Integrals. y x

16.5. Maclaurin and Taylor Series. Introduction. Prerequisites. Learning Outcomes

5. Zeros. We deduce that the graph crosses the x-axis at the points x = 0, 1, 2 and 4, and nowhere else. And that s exactly what we see in the graph.

1.2 Functions and Their Properties PreCalculus

LESSON 35: EIGENVALUES AND EIGENVECTORS APRIL 21, (1) We might also write v as v. Both notations refer to a vector.

11.4 Polar Coordinates

Biostatistics in Research Practice - Regression I

Section 1.2: A Catalog of Functions

4.7. Newton s Method. Procedure for Newton s Method HISTORICAL BIOGRAPHY

Vertex. March 23, Ch 9 Guided Notes.notebook

INTRODUCTION TO DIOPHANTINE EQUATIONS

2.5 CONTINUITY. a x. Notice that Definition l implicitly requires three things if f is continuous at a:

Methods for Advanced Mathematics (C3) Coursework Numerical Methods

Polynomial Functions and their Graphs

Ch 3 Alg 2 Note Sheet.doc 3.1 Graphing Systems of Equations

14.1 Systems of Linear Equations in Two Variables

Lecture 5. Equations of Lines and Planes. Dan Nichols MATH 233, Spring 2018 University of Massachusetts.

we make slices perpendicular to the x-axis. If the slices are thin enough, they resemble x cylinders or discs. The formula for the x

7. Choice of approximating for the FE-method scalar problems

5.2 Infinite Series Brian E. Veitch

Polynomial and Rational Functions

ES.182A Problem Section 11, Fall 2018 Solutions

Solutions to Two Interesting Problems

Vectors and the Geometry of Space

LESSON #42 - INVERSES OF FUNCTIONS AND FUNCTION NOTATION PART 2 COMMON CORE ALGEBRA II

Higher. Integration 1

Methods of Solving Ordinary Differential Equations (Online)

CMSC427 Parametric curves: Hermite, Catmull-Rom, Bezier

5.4 dividing POlynOmIAlS

c) Words: The cost of a taxicab is $2.00 for the first 1/4 of a mile and $1.00 for each additional 1/8 of a mile.

3 Polynomial and Rational Functions

LESSON #12 - FORMS OF A LINE COMMON CORE ALGEBRA II

8.1 Exponents and Roots

MATH Line integrals III Fall The fundamental theorem of line integrals. In general C

Bézier Curves and Splines

Affine transformations

Physics Gravitational force. 2. Strong or color force. 3. Electroweak force

Green s Theorem Jeremy Orloff

Wave Phenomena Physics 15c

AP Calculus AB Summer Assignment

Lab 5 Forces Part 1. Physics 211 Lab. You will be using Newton s 2 nd Law to help you examine the nature of these forces.

t s time we revisit our friend, the equation of a line: y = mx + b

5.6 RATIOnAl FUnCTIOnS. Using Arrow notation. learning ObjeCTIveS

Section 3.1. ; X = (0, 1]. (i) f : R R R, f (x, y) = x y

A function from a set D to a set R is a rule that assigns a unique element in R to each element in D.

LESSON #11 - FORMS OF A LINE COMMON CORE ALGEBRA II

Roberto s Notes on Integral Calculus Chapter 3: Basics of differential equations Section 3. Separable ODE s

Math Notes on sections 7.8,9.1, and 9.3. Derivation of a solution in the repeated roots case: 3 4 A = 1 1. x =e t : + e t w 2.

2.5. Infinite Limits and Vertical Asymptotes. Infinite Limits

Wave Phenomena Physics 15c

Pre-AP Algebra 2 Lesson 1-1 Basics of Functions

5.6. Differential equations

We have examined power functions like f (x) = x 2. Interchanging x

Unit 3 NOTES Honors Common Core Math 2 1. Day 1: Properties of Exponents

AP Calculus AB Summer Assignment

Page 1. These are all fairly simple functions in that wherever the variable appears it is by itself. What about functions like the following, ( ) ( )

Mathematics 309 Conic sections and their applicationsn. Chapter 2. Quadric figures. ai,j x i x j + b i x i + c =0. 1. Coordinate changes

Strain Transformation and Rosette Gage Theory

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

8.4 Inverse Functions

Table of Contents. Module 1

Solutions to the Math 1051 Sample Final Exam (from Spring 2003) Page 1

Overview. IAML: Linear Regression. Examples of regression problems. The Regression Problem

Interpolation and polynomial approximation Interpolation

Reading. 4. Affine transformations. Required: Watt, Section 1.1. Further reading:

Tangent Lines. Limits 1

Moment of Inertia. Moment of Inertia

1.10 Continuity Brian E. Veitch

8.7 Systems of Non-Linear Equations and Inequalities

Math 123 Summary of Important Algebra & Trigonometry Concepts Chapter 1 & Appendix D, Stewart, Calculus Early Transcendentals

The degree of the polynomial function is n. We call the term the leading term, and is called the leading coefficient. 0 =

Introduction to Vector Spaces Linear Algebra, Spring 2011

12.1 Systems of Linear equations: Substitution and Elimination

Lab 5 Forces Part 1. Physics 225 Lab. You will be using Newton s 2 nd Law to help you examine the nature of these forces.

Lesson 29 MA Nick Egbert

Math Review Packet #5 Algebra II (Part 2) Notes

CONTROL POLYGONS FOR CUBIC CURVES

1.6 CONTINUITY OF TRIGONOMETRIC, EXPONENTIAL, AND INVERSE FUNCTIONS

ALGEBRA 2 NY STATE COMMON CORE

Chapter 3: Three faces of the derivative. Overview

ES.182A Topic 36 Notes Jeremy Orloff

Feedforward Neural Networks

Representation of Functions by Power Series. Geometric Power Series

Reading. w Foley, Section 11.2 Optional

a. plotting points in Cartesian coordinates (Grade 9 and 10), b. using a graphing calculator such as the TI-83 Graphing Calculator,

Math 214 Spring problem set (a) Consider these two first order equations. (I) dy dx = x + 1 dy

Chapter 5: Systems of Equations

Cubic Splines; Bézier Curves

Equations of lines in

Laboratory and Rotating frames

Introduction to Computer Graphics. Modeling (1) April 13, 2017 Kenshi Takayama

4 The Cartesian Coordinate System- Pictures of Equations

Calculus: What is a Limit? (understanding epislon-delta proofs)

Finding Limits Graphically and Numerically. An Introduction to Limits

Polynomial and Rational Functions

D u f f x h f y k. Applying this theorem a second time, we have. f xx h f yx k h f xy h f yy k k. f xx h 2 2 f xy hk f yy k 2

Transcription:

Polnomial approimation and Splines 1. Weierstrass approimation theorem The basic question we ll look at toda is how to approimate a complicated function f() with a simpler function P () f() P () for eample, where P () is a polnomial of degree d. There are a variet of approaches. We have the following theorem: Weierstrass Approimation Theorem For ever continuous function f() on [a, b] and ever ɛ > 0 there is a polnomial P () such that f() P () < ɛ for each [a, b]. This is a useful idea for computer graphics and computer aided design. Instead of storing a lot of data (function values, bitmap images), just store a few numbers (polnomial coefficients), and generate the approimate function values when ou need them. In general, a polnomial of degree n has n + 1 coefficients, so we ll fit P to f using n + 1 equations in some wa. There are various was to do that. 2. Talor polnomials The idea here is to match the value of f and the values of n of its derivatives at a single point 0. That gives us our n + 1 equations. B Talor s theorem, P () = f (k) ( 0 ) ( 0 ) k. k! The problem is that this can be a great approimation near 0, but a lous one far awa. It works well for f s like polnomials or eponential functions, but not for other functions. In Figures 1-3 I ve plotted the n = 3, 5, 7 approimations to f 1 () = sin. This method is a good thing to tr if ou onl care about 0. It is often not a good choice for interpolating between widel separated values 0 and 1. These won t prove the theorem, even for infinitel differentiable f, as the following eample shows { e 1/2, > 0 Eample: Let f 2 () = 0, 0. Then f 2 is infinitel differentiable, but one can show that f2() 0 when 0. n This implies that f (k) 2 (0) = 0 for ever k. Therefore when 0 = 0, the Talor polnomials are all P () = 0. 1

2 Figure 1. Degree 3 Talor appro. to = sin, about 0 = 0 Figure 2. Degree 5 Talor appro. to = sin, about 0 = 0 3. Lagrange polnomials The idea here is that we get our n + 1 equations b matching the values of f at n + 1 points 0,..., n (called nodes) n i P () = f( k ). k i i=0,i k

3 Figure 3. Degree 7 Talor appro. to = sin, about 0 = 0 For eample, if ou substitue = j then the k j terms in the sum all = 0, and the k = j term gives f( j ). Figure 4 plots the Lagrange interpolation to the above f 2 with nodes -1.5, -1, -.5, 0,.5, 1, 1.5, 2. We re using 8 nodes, so the fit is with a degree n = 7 polnomial. It does a lot better than Talor s P () = 0, but it is still prett wiggl (ie it is eas to overfit using this method). 4. Hermite polnomials The idea here is that we get n + 1 equations b matching the values and first derivatives of f at n+1 2 points. For eample, with a cubic P we match four pieces of data at two points: f( 0 ), f ( 0 ), f( 1 ), f ( 1 ). There s a formula for this, which I ll write down but won t prove: P () = f( 0 ) ( 1 ) 2 ( 1 3 0 + 2) ( 1 0 ) 3 + f( 1 ) ( 0) 2 (3 1 0 2) ( 1 0 ) 3 + f ( 0 ) ( 0)( 1 ) 2 ( 1 0 ) 2 f ( 1 ) ( 0) 2 ( 1 ) ( 1 0 ) 2. 5. Splines The above can still be prett wiggl. To get more practical approimations, split up [a, b] into k pieces [ 0, 1 ],..., [ k 1, k ], and approimate on each using a different polnomial P j, j = 1,..., k. If we use cubics to do this, then we re tring to match 4k parameters via 4k equations. There are several was of doing this. 5.1. Hermite spline: Use Hermite interpolation to match f( k ) and f ( k ) at the beginning and end of each interval. Put another wa, we impose the constraints f( 0 ) = P 1 ( 0 ), f ( 0 ) = P 1( 0 ), f( k ) = P k ( k ), f ( k ) = P k ( k), and for j = 1

4-0.5 0.0 0.5 1.0-2 -1 0 1 2 Figure 4. A degree 7 Lagrange interpolation for = f 2 () to k 1: f( j ) = P j ( j ) = P j+1 ( j ) and f ( j ) = P j ( j) = P j+1 ( j). Because we have a nice formula for Hermite interpolation, this is eas to work out. In Figure 5 I ve plotted this for the eample f 2 with k = 3, and nodes at 0 = 2, 1 = 0.25, 2 = 1, and 3 = 2. This means we re fitting 12 parameters this time. It doesn t quite handle the sharp turn, but awa from there it is ecellent. -0.5 0.0 0.5 1.0-2 -1 0 1 2 Figure 5. A 3-window Hermite spline for = f 2 ()

5 5.2. Cubic spline: With this approach, we won t worr about matching the f ( j ), for j = 1,..., k 1. That saves us 2(k 1) constraints. Instead just make the k 1 derivatives match: P j ( j) = P j+1 ( j), and then make the k 1 second derivatives also match: P j ( j) = P j+1 ( j). The onl derivative information we use is at the ver beginning and end, but we get smoother solutions because the 2nd derivatives no longer jump. There isn t a simple formula for the coefficients an more now one needs to do some numerical linear algebra to figure them out (the solve a tridiagonal sstem ), but that is eas to do numericall, and it tpicall gives ecellent looking results. This approach is widel used in computer graphics and computer aided design. 6. Bezier curves This works fine for functions. But what about approimating curves? Now use parametric curves = P (t) and = Q(t). Using splines for each can certainl be made to work easil enough. But if ou re tring to use this to draw, ou want something geometric that is eas to adjust. In that setting, what people do is break the curve up into k arcs, and use cubic Hermite polnomials for P and Q. We need to specif values and derivatives for both and at each of k + 1 values of t. We do that in a geometric wa b giving guidepoints, ie ( j, j ) and ( j + j, j + j ). If ou use a sophisticated computer drawing program, ou ll find these somewhere in it. 7. Bernstein polnomials Let s go back to the original problem. How does one prove the Weierstrass Approimation theorem (sa on [0, 1])? The slickest proof is using the Bernstein polnomials ( ) n ( k P () = f k n) k (1 ) n k. The idea here is that if N has a Binomial(n, ) distribution, then f() = f(e[ N n ]) and P () = E[f( N n )]. So the should be close, b the law of large numbers. In fact, chasing through the standard proof of the law of large numbers, one can turn this into a rigorous proof. 8. Orthogonal polnomials There are other classes of polnomials used for approimation, for eample the Legendre polnomials or the Chebshev polnomials. Calculations for them are based on an orthogonalit propert, ver much like what happens for Fourier series. So we ll focus on those instead.