Numeriska beräkningar i Naturvetenskap och Teknik Today’s topic: Approximations Least square method Interpolations Fit of polynomials Splines.

Slides:



Advertisements
Similar presentations
Today’s topic: Some Celestial Mechanics F Numeriska beräkningar i Naturvetenskap och Teknik.
Advertisements

The topic: Least squares method Numeriska beräkningar i Naturvetenskap och Teknik.
Mark Trew CT Halfway Down Halfway down the stairs Is a stair Where I sit. There isn't any Other stair Quite like It. I'm not at the bottom, I'm.
Interpolation A standard idea in interpolation now is to find a polynomial pn(x) of degree n (or less) that assumes the given values; thus (1) We call.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Numeriska beräkningar i Naturvetenskap och Teknik Today’s topic: Some Celestial Mechanics F.
Numeriska beräkningar i Naturvetenskap och Teknik 1.Solving equations.
Numeriska beräkningar i Naturvetenskap och Teknik 1. Numerical differentiation and quadrature Discrete differentiation and integration Trapezoidal and.
Numerical Methods.  Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain.
Data mining and statistical learning - lecture 6
MATH 685/ CSI 700/ OR 682 Lecture Notes
Chapter 18 Interpolation The Islamic University of Gaza
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
Chapter 5 Orthogonality
Curve-Fitting Interpolation
3D Geometry for Computer Graphics. 2 The plan today Least squares approach  General / Polynomial fitting  Linear systems of equations  Local polynomial.
Curve-Fitting Regression
Curve-Fitting Polynomial Interpolation
Lecture 12 Projection and Least Square Approximation Shang-Hua Teng.
Lecture 12 Least Square Approximation Shang-Hua Teng.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 24 Regression Analysis-Chapter 17.
Computer Graphics Recitation The plan today Least squares approach  General / Polynomial fitting  Linear systems of equations  Local polynomial.
Chapter 6 Numerical Interpolation
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 Least.
Lecture 10: Inner Products Norms and angles Projection Sections 2.10.(1-4), Sections 2.2.3, 2.3.
Least-Squares Regression
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
CHAPTER FIVE Orthogonality Why orthogonal? Least square problem Accuracy of Numerical computation.
MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)
Simpson Rule For Integration.
Scientific Computing Linear Least Squares. Interpolation vs Approximation Recall: Given a set of (x,y) data points, Interpolation is the process of finding.
V. Space Curves Types of curves Explicit Implicit Parametric.
Regression analysis Control of built engineering objects, comparing to the plan Surveying observations – position of points Linear regression Regression.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Orthogonality and Least Squares
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Chapter 8 Curve Fitting.
Curve-Fitting Regression
By Adam Mallen.  What is it?  How is it different from regression?  When would you use it?  What can go wrong?  How do we find the interpolating.
6. Introduction to Spectral method. Finite difference method – approximate a function locally using lower order interpolating polynomials. Spectral method.
AGC DSP AGC DSP Professor A G Constantinides©1 Hilbert Spaces Linear Transformations and Least Squares: Hilbert Spaces.
Elementary Linear Algebra Anton & Rorres, 9th Edition
Scientific Computing General Least Squares. Polynomial Least Squares Polynomial Least Squares: We assume that the class of functions is the class of all.
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #15 Spline Interpolation.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
L5 – Curves in GIS NGEN06 & TEK230: Algorithms in Geographical Information Systems by: Sadegh Jamali (source: Lecture notes in GIS, Lars Harrie) 1 L5-
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
Curve Fitting Introduction Least-Squares Regression Linear Regression Polynomial Regression Multiple Linear Regression Today’s class Numerical Methods.
1 MAC 2103 Module 11 lnner Product Spaces II. 2 Rev.F09 Learning Objectives Upon completing this module, you should be able to: 1. Construct an orthonormal.
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Camera Calibration Course web page: vision.cis.udel.edu/cv March 24, 2003  Lecture 17.
Interpolation - Introduction
Lecture 16: Image alignment
Part 5 - Chapter
Curve-Fitting Spline Interpolation
Chapter 12 Curve Fitting : Fitting a Straight Line Gab-Byung Chae
Linear regression Fitting a straight line to observations.
Orthogonality and Least Squares
Nonlinear regression.
Regression Lecture-5 Additional chapters of mathematics
MATH 174: Numerical Analysis I
Discrete Least Squares Approximation
Lecture 8: Image alignment
SKTN 2393 Numerical Methods for Nuclear Engineers
Orthogonality and Least Squares
Approximation of Functions
Approximation of Functions
Presentation transcript:

Numeriska beräkningar i Naturvetenskap och Teknik Today’s topic: Approximations Least square method Interpolations Fit of polynomials Splines

Numeriska beräkningar i Naturvetenskap och Teknik An exemple Modell Why do the measured values deviate from the mode if the measurement is correct?

Numeriska beräkningar i Naturvetenskap och Teknik How determine the ‘best’ straight line? Model

Numeriska beräkningar i Naturvetenskap och Teknik Distance between line and measurements points...

Numeriska beräkningar i Naturvetenskap och Teknik How to define the distance between the line and the measurement points? Largest deviation at minimum Approximation in maximum norm Sum of deviations squared as small as possible Approximation in Euclidian norm Easier to calculate! Norm

Numeriska beräkningar i Naturvetenskap och Teknik Matrix formulation: An example with More equations than unknowns!

Numeriska beräkningar i Naturvetenskap och Teknik Matrix formulation: An exampe

Numeriska beräkningar i Naturvetenskap och Teknik Matrix formulation: An example

Numeriska beräkningar i Naturvetenskap och Teknik Matrix formulation: An example

Numeriska beräkningar i Naturvetenskap och Teknik General Statement of the Problem: Depending on the model, the measurement data can of course be described by other expressions than the straight line. In general terms one seeks a function f* that approximates f’s given values as good as possible in euclidian norm. Specifically, above we looked for a solution expressed as but we could as well have looked for a solution given by another function (possibly then for different data) etc...

Numeriska beräkningar i Naturvetenskap och Teknik Generally one can thus write: f(x) is in other words a linear combination of given functions Where the coefficients are sought One can in accordande with a vector space look at it so that Spans a function space (a space of this kind which fulfills certain conditions is called a Hilbert space, cmp. quant. mech)

Numeriska beräkningar i Naturvetenskap och Teknik In the case of the straight line we have In a geometrical comparision these two functions, which can be seen as two vectors in the function space, span a plane U: ”vector” 0 ”vector” 1 Approximating function sought function The smallest distance from the plane is given by a normal. The smallest deviation between f* och f is for f*-f orthogonal to the plane U!

Numeriska beräkningar i Naturvetenskap och Teknik Normal equations Since we are interested in fitting m measured values we leave the picture of the continuous function space and view f(x) as an m-dimensional vector with values: That should be expressed byand For the straight line:

Numeriska beräkningar i Naturvetenskap och Teknik The orthogonality condition now gives the equations: where the equations for the normal: Which gives

Numeriska beräkningar i Naturvetenskap och Teknik The equations for the normal :

Numeriska beräkningar i Naturvetenskap och Teknik Back to the exemple: Model:Data:

Numeriska beräkningar i Naturvetenskap och Teknik Conclusion: the minimum of is orthogonal to the basis vectors Assuming the modelGiven data is obtained when The coefficienterna c 1, c 2, c 3, c n are determined from

Numeriska beräkningar i Naturvetenskap och Teknik The equations or Where the colomuns in A are:

Numeriska beräkningar i Naturvetenskap och Teknik Note 1: The func’sHave to be linearly independent (cmp vectors in a vector space) Note 2: Assume our problem would have been (x koord -996) cmp to

Numeriska beräkningar i Naturvetenskap och Teknik Gauss’ elimination method:

Numeriska beräkningar i Naturvetenskap och Teknik Gauss’ elimination method:

Numeriska beräkningar i Naturvetenskap och Teknik Error sources 1. Mätdata, E f

Numeriska beräkningar i Naturvetenskap och Teknik Error sources 2. Truncation errorThese would be zero for a first degree polynomial

Numeriska beräkningar i Naturvetenskap och Teknik The approximation to data assumes to pass through the data points, i.e. one assumes the errors are small. Linear interpolation Alt for equidistant data Interpolation

Numeriska beräkningar i Naturvetenskap och Teknik Quadratic interpolation Ansatz 1 2 3

Numeriska beräkningar i Naturvetenskap och Teknik Quadratic interpolation 3

Numeriska beräkningar i Naturvetenskap och Teknik Quadratic interpolation Newton’s ansatz Uniqueness: There is only one polynomial of order m that passes through m+1 points.

Numeriska beräkningar i Naturvetenskap och Teknik Error interpolation Linear interpolation

Numeriska beräkningar i Naturvetenskap och Teknik Exemple Interpolation of polynomial of order 4,8,16 in equidistant points Fit of polynomial of order 6 to 9 equidistant points

Numeriska beräkningar i Naturvetenskap och Teknik 4th order 8th order 16th order 6th order in 9 points

Numeriska beräkningar i Naturvetenskap och Teknik Runge’s phenomenon Interpolation in equidistant points by a polynomal of high order tends to reproduce a curve better in the central parts of the interval but gives considerable oscillations close to the end-points of the interval! Chebychev polynomials and Chebychev abscissa If one can select the points in which data is known (this can be hard if the measurement values are already given… ) then the data points should be closer close to the end-points of the interval. An optimal choice is given by the zeros of the Chebychev polynomial of order m which minimizes the residue above.

Numeriska beräkningar i Naturvetenskap och Teknik Splines An alternative is to use a polynomial piece wise between the points. One can e.g. set the condition that the function’s values, its derivative and second derivative is equal in the end points of each short interval for polynomials that meet in these points. This approach gives so-called cubic splines. In the extreme end-points one can e.g. demand the curve to be straight.

Numeriska beräkningar i Naturvetenskap och Teknik Cubic splines FunctionDerivative Second derivative

Numeriska beräkningar i Naturvetenskap och Teknik Insertion: Function Derivative Second derivative

Numeriska beräkningar i Naturvetenskap och Teknik The condtions and give

Numeriska beräkningar i Naturvetenskap och Teknik the following system in matrix form: Easy to solve! Try out MATLABs spline function on your own!