Curve Fitting Filling in the gaps.

Slides:



Advertisements
Similar presentations
Kin 304 Regression Linear Regression Least Sum of Squares
Advertisements

Probabilistic & Statistical Techniques Eng. Tamer Eshtawi First Semester Eng. Tamer Eshtawi First Semester
Ch11 Curve Fitting Dr. Deshi Ye
MATH 685/ CSI 700/ OR 682 Lecture Notes
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
Curve-Fitting Polynomial Interpolation
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 23 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
Chapter 6 Numerical Interpolation
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved Section 10-3 Regression.
Empirical Modeling Dongsup Kim Department of Biosystems, KAIST Fall, 2004.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on the Least-Squares Regression Model and Multiple Regression 14.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
1. Interpolating polynomials Polynomial of degree n,, is a linear combination of Definitions: (interval, continuous function, abscissas, and polynomial)
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
Principles of Extrapolation
Curve Fitting Introduction Least-Squares Regression Linear Regression Polynomial Regression Multiple Linear Regression Today’s class Numerical Methods.
1 1 Slide The Simple Linear Regression Model n Simple Linear Regression Model y =  0 +  1 x +  n Simple Linear Regression Equation E( y ) =  0 + 
1 Objective Given two linearly correlated variables (x and y), find the linear function (equation) that best describes the trend. Section 10.3 Regression.
Lecture 29: Modeling Data. Data Modeling Interpolate between data points, using either linear or cubic spline models Model a set of data points as a polynomial.
1 Approximating functions, polynomial interpolation (Lagrange and Newton’s divided differences) formulas, error approximations.
Lecture Slides Elementary Statistics Twelfth Edition
Linear Regression Essentials Line Basics y = mx + b vs. Definitions
Correlation & Forecasting
Regression and Correlation
Chapter 7. Classification and Prediction
Part 5 - Chapter
ECE3340 Numerical Fitting, Interpolation and Approximation
Differential Equations
Curve-Fitting Spline Interpolation
Numerical Analysis Lecture 25.
Exponents, Polynomials, and Polynomial Functions
Chapter 11 Simple Regression
Statistics for Business and Economics (13e)
Elementary Statistics
Slides by JOHN LOUCKS St. Edward’s University.
2.1 Equations of Lines Write the point-slope and slope-intercept forms
Interpolation.
4.2 Polynomial Functions and Models
Exponents, Polynomials, and Polynomial Functions
Chapter 9 Function Approximation
4.2 Properties of Polynomial Graphs
Correlation and Regression
Chapter 7 Numerical Differentiation and Integration
Modelling data and curve fitting
Today’s class Multiple Variable Linear Regression
Functions, Graphs, and Limits
J.-F. Pâris University of Houston
Numerical Analysis Lecture 23.
Numerical Analysis Lecture 26.
MATH 174: Numerical Analysis
Numerical Computation and Optimization
Regression Lecture-5 Additional chapters of mathematics
Correlation and Regression
Ch11 Curve Fitting II.
Least Square Regression
7.1 Draw Scatter Plots & Best-Fitting Lines
Correlation and Regression
Principal Components What matters most?.
Statistics for Business and Economics
9. Data Fitting Fitting Experimental Spectrum
SKTN 2393 Numerical Methods for Nuclear Engineers
Polynomial Functions and Graphs
Multiple Regression Copyright © 2007 Pearson Education, Inc Publishing as Pearson Addison-Wesley.
Numerical Analysis Lecture 24.
St. Edward’s University
Approximation of Functions
Approximation of Functions
Theory of Approximation: Interpolation
Presentation transcript:

Curve Fitting Filling in the gaps

Copyright G. A. Tagliarini, PhD Basic Problem Given sample points x1 < x2 < …< xn and sample data values y1, y2,…, yn corresponding to the xi, for 1 ≤ i ≤ n Find a function f such that y1 = f(x1), y2 = f(x2), …, yn = f(xn) Typically an approximate match is sought Additional design constraints, such as continuity or differentiability may apply 5/14/2019 Copyright G. A. Tagliarini, PhD

Least Squares Approximation 5/14/2019 Copyright G. A. Tagliarini, PhD

Copyright G. A. Tagliarini, PhD Estimating Values Interpolation is estimating the value of the data generating function for x ε [x1, xn] and x ≠ xi. Extrapolation is estimating the value of the data generating function for x outside the interval [x1, xn]. 5/14/2019 Copyright G. A. Tagliarini, PhD

Recall from Analytic Geometry (x2, y2) (x1, y1) (x2, y1) 5/14/2019 Copyright G. A. Tagliarini, PhD

Piece-wise Linear Interpolation (x2, y2) (xn, yn) (x1, y1) (x3, y3) 5/14/2019 Copyright G. A. Tagliarini, PhD

Polynomial Interpolation A polynomial p(x) is a function of the form p(x) = anxn + an-1xn-1+…+a1x+a0 If n is the largest power of x for which an ≠ 0, then p(x) is of degree n The n+1 coefficients ai are the undetermined values Assume n+1 samples to find a polynomial of degree n that passes through the sample points…Does one exist? How to find it? 5/14/2019 Copyright G. A. Tagliarini, PhD

Polynomial Approximation Polynomials are universal approximators for continuous functions on closed intervals Weierstrass Approximation Theorem Given F(x) continuous on [a, b] and any e>0 no matter how small There exists a polynomial f(x) such that |F(x)-f(x)|<e for all x in [a, b] This is an existence theorem. 5/14/2019 Copyright G. A. Tagliarini, PhD

Polynomial Interpolation Process 5/14/2019 Copyright G. A. Tagliarini, PhD

Re-writing as a Matrix Equation 5/14/2019 Copyright G. A. Tagliarini, PhD

Conditions for a Solution Given the linear system y = X a from the previous slide X-1 exists so that we can find a = X-1 y if the xi are all distinct This condition was met by our initial assumptions For many curve fitting problems (e.g., regression) this assumption is unmet X rapidly becomes ill-conditioned as n increases 5/14/2019 Copyright G. A. Tagliarini, PhD

Example: Polynomial Fit Find a cubic passing through (-1, -11), (0, -5), (1, -5), and (2, 1) Graph System 5/14/2019 Copyright G. A. Tagliarini, PhD

Example: Polynomial Fit (continued) 5/14/2019 Copyright G. A. Tagliarini, PhD

Example: Polynomial Fit (continued) 5/14/2019 Copyright G. A. Tagliarini, PhD

Copyright G. A. Tagliarini, PhD Lagrange Polynomials Expansion using the natural basis 1, x, x2, …, xn,… may give rise to numerical difficulties from searching for the inverse of an ill-conditioned matrix An alternative basis may provide a better representation 5/14/2019 Copyright G. A. Tagliarini, PhD

Lagrange Polynomial Definition 5/14/2019 Copyright G. A. Tagliarini, PhD

Example Lagrange Polynomials 5/14/2019 Copyright G. A. Tagliarini, PhD

Example Lagrange Polynomials 5/14/2019 Copyright G. A. Tagliarini, PhD

An Orthogonality Property Qk(xj) = 1 if k=j Qk(xj) = 0 if k≠j 5/14/2019 Copyright G. A. Tagliarini, PhD

The Approximation Formula 5/14/2019 Copyright G. A. Tagliarini, PhD

Plotting the Lagrange Polynomials and Their Sum 5/14/2019 Copyright G. A. Tagliarini, PhD

Lagrange Example Finished For the data points (-1, -11), (0, -5), (1, -5), and (2, 1) The polynomial f is given by f(x) = -11Q1(x)+ -5Q2(x) + -5Q3(x) + 1Q4(x) = 2x3 – 3x2 + 1x – 5 which by now should look familiar! (Can you show this?) 5/14/2019 Copyright G. A. Tagliarini, PhD

Copyright G. A. Tagliarini, PhD Linear Correlation Data may be represented in a scattergram Positive correlation results when the dependent variable’s (y) values increase as the independent variable’s (x) values increase. Negative correlation results when the dependent variable’s (y) values decrease as the independent variable’s (x) values increase. 5/14/2019 Copyright G. A. Tagliarini, PhD

Copyright G. A. Tagliarini, PhD Sample Scattergrams 5/14/2019 Copyright G. A. Tagliarini, PhD

Copyright G. A. Tagliarini, PhD Notation X and Y represent the distributions of independent and dependent variable values Critical values of r depend upon the significance level a of the test (typically, a=0.05 or a=0.01), the type of test (one tail or two tail), and the number of data pairs n 5/14/2019 Copyright G. A. Tagliarini, PhD

Pearson’s r: The Coefficient of Correlation 5/14/2019 Copyright G. A. Tagliarini, PhD

Copyright G. A. Tagliarini, PhD Prediction Equation 5/14/2019 Copyright G. A. Tagliarini, PhD

Copyright G. A. Tagliarini, PhD Cubic Splines 5/14/2019 Copyright G. A. Tagliarini, PhD