Fitting to a set of data. Lecture on fitting

Similar documents
Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

lecture 10: B-Splines

February 2017 (1/20) 2 Piecewise Polynomial Interpolation 2.2 (Natural) Cubic Splines. MA378/531 Numerical Analysis II ( NA2 )

February 23 Math 2335 sec 51 Spring 2016

Computational Physics PHYS 420

1. Answer: x or x. Explanation Set up the two equations, then solve each equation. x. Check

Interpolation by Spline Functions

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010

CS 450 Numerical Analysis. Chapter 7: Interpolation

Lecture 9: Introduction to Spline Curves

Need for Parametric Equations

1.12 Optimal Filters (Wiener Filters)

Knowledge Discovery and Data Mining

Four equations are necessary to evaluate these coefficients. Eqn

Justify all your answers and write down all important steps. Unsupported answers will be disregarded.

ES-2 Lecture: Fitting models to data

Computation of interpolatory splines via triadic subdivision

Handout 4 - Interpolation Examples

Consider functions such that then satisfies these properties: So is represented by the cubic polynomials on on and on.

Assignment 2. with (a) (10 pts) naive Gauss elimination, (b) (10 pts) Gauss with partial pivoting

Section 18-1: Graphical Representation of Linear Equations and Functions

Machine Learning / Jan 27, 2010

Sung-Eui Yoon ( 윤성의 )

MA 323 Geometric Modelling Course Notes: Day 21 Three Dimensional Bezier Curves, Projections and Rational Bezier Curves

3, 10,( 2, 4) Name. CP Algebra II Midterm Review Packet Unit 1: Linear Equations and Inequalities. Solve each equation. 3.

Concept of Curve Fitting Difference with Interpolation

An introduction to interpolation and splines

Grade 9 Math Terminology

CS 4620 Final Exam. (a) Is a circle C 0 continuous?

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331

Properties of Blending Functions

Operators to calculate the derivative of digital signals

Algebra 2 Common Core Summer Skills Packet

Derivative. Bernstein polynomials: Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 313

Basis Functions. Volker Tresp Summer 2017

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Interpolation and Basis Fns

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Curve fitting using linear models

Lecture VIII. Global Approximation Methods: I

Numerical Methods 5633

SLStats.notebook. January 12, Statistics:

UNIT 1: NUMBER LINES, INTERVALS, AND SETS

Introduction to ANSYS DesignXplorer

Dgp _ lecture 2. Curves

ECE 600, Dr. Farag, Summer 09

Mid-Chapter Quiz: Lessons 2-1 through 2-3

Things to Know for the Algebra I Regents

B-Spline Polynomials. B-Spline Polynomials. Uniform Cubic B-Spline Curves CS 460. Computer Graphics

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image

Design considerations

Graphing Rational Functions

5.1 Introduction to the Graphs of Polynomials

Using Arithmetic of Real Numbers to Explore Limits and Continuity

SYSTEMS OF NONLINEAR EQUATIONS

RSI SMOOTHING By John Ehlers

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation

Bézier Splines. B-Splines. B-Splines. CS 475 / CS 675 Computer Graphics. Lecture 14 : Modelling Curves 3 B-Splines. n i t i 1 t n i. J n,i.

ADAPTIVE APPROACH IN NONLINEAR CURVE DESIGN PROBLEM. Simo Virtanen Rakenteiden Mekaniikka, Vol. 30 Nro 1, 1997, s

Interpolation. TANA09 Lecture 7. Error analysis for linear interpolation. Linear Interpolation. Suppose we have a table x x 1 x 2...

Natural Quartic Spline

Central issues in modelling

Drawing hypergraphs using NURBS curves

Fatima Michael College of Engineering & Technology

Rational Bezier Curves

VW 1LQH :HHNV 7KH VWXGHQW LV H[SHFWHG WR

8 Piecewise Polynomial Interpolation

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /4:30-6:00

1 MATH 253 LECTURE NOTES for FRIDAY SEPT. 23,1988: edited March 26, 2013.

See the course website for important information about collaboration and late policies, as well as where and when to turn in assignments.

8 Project # 2: Bézier curves

CS 475 / CS Computer Graphics. Modelling Curves 3 - B-Splines

Vocabulary Unit 2-3: Linear Functions & Healthy Lifestyles. Scale model a three dimensional model that is similar to a three dimensional object.

A story about Non Uniform Rational B-Splines. E. Shcherbakov

Rational functions, like rational numbers, will involve a fraction. We will discuss rational functions in the form:

MAT 003 Brian Killough s Instructor Notes Saint Leo University

Camera calibration. Robotic vision. Ville Kyrki

1. Assumptions. 1. Introduction. 2. Terminology

Algebra 1 Vocabulary (The first choice is the correct answer) 1. y=mx+b

Piecewise polynomial interpolation

COMP3421. Global Lighting Part 2: Radiosity

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.

Lecture 9. Curve fitting. Interpolation. Lecture in Numerical Methods from 28. April 2015 UVT. Lecture 9. Numerical. Interpolation his o

Lecture 4: Image Processing

Generalized barycentric coordinates

Interactive Math Glossary Terms and Definitions

FMA901F: Machine Learning Lecture 3: Linear Models for Regression. Cristian Sminchisescu

Intro to Curves Week 1, Lecture 2

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Slide 1 / 96. Linear Relations and Functions

Math Numerical Analysis Homework #3 Solutions

Math 225 Scientific Computing II Outline of Lectures

Economics Nonparametric Econometrics

CS-184: Computer Graphics. Today

Machine Learning Techniques on Multidimensional Curve Fitting Data Based on R- Square and Chi-Square Methods

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

HiQ Analysis, Visualization, and Report Generation

Curve fitting. Lab. Formulation. Truncation Error Round-off. Measurement. Good data. Not as good data. Least squares polynomials.

Transcription:

Fitting to a set of data Lecture on fitting

Linear regression Linear regression Residual is the amount difference between a real data point and a modeled data point Fitting a polynomial to data Could use minimization of the sum of residuals Cancellation errors Could bisect a set of points rather than fitting through them Could use minimization of the sum of the absolute value of the residuals Too much influence to outliers Could use minimization of the sum of the square of the residuals Works well Solves problems mention in the other two methods

Least square Least square form, take derivative n S= y i,measured y i,model 2 i=1 n S= y i a o a 1 x i 2 i=1 y model =mx i b=a 0 a 1 x i S a 0 = 2 y i a 0 a 1 x i =0 S a 1 = 2 y i a 0 a 1 x 1 x i =0 slope=a 1 = n x i y i x i y i n x i 2 x i 2 a o = y a 1 x

Polyfit (from Octave) Take some data x,y (error sy) Fit line using polyfit as so >>[a,b] = polyfit(x,y,1) >>plot(x,y,'*') >>Line = a(1)*x+a(2) >>Hold on >>plot(x,line,'-+g') - or more professionally - >>[p,s] = wpolyfit(x,y,sy,1) >>[yn,syn]=polyconf(p,x,s,'ci') >> plot(x,yn,'gd-')

Nonlinear regression Cannot solve like the least square method Use Gauss-Newton optimization method Think Levenberg-Marquardt which is an optimization method of this nature Think least square/minimization/idea/concept

Interpolation >>slope = (y(5)-y(4))/(x(5)-x(4)) >>intercept=y(4)-slope*x(4) >>newline=slope*x+intercept >>plot(x,y,'*') >> hold on >>plot(x(4:5),newline(4:5)) >>%% Clearly I can now get a point >>%% in the middle >>point=slope*3.4+intercept This is a simple way of interpolating clearly it could be argued that a fitted line would be more appropriate than a slope-intercept form. Splines are often used

Extrapolation >>slope = (y(5)-y(4))/(x(5)-x(4)) >>intercept=y(4)-slope*x(4) >> %% xx is x extended >>newline=slope*xx+intercept >>plot(x,y,'*') >> hold on >>plot(xx(10:12),newline2(10:12)) >>%% Clearly I can now get a point >>%% in the beyond the data >>point=slope*10.6+intercept This is a simple way of extrapolation clearly it could be argued that a fitted line would be more appropriate than a slope-intercept form. Splines are often used

Spline Fits splines (curves) through the data Fits data (usually noisy) through knots Good method Requires picking knot locations Fits through knots using best method Use a spline like in boats to fit through the points (or knots) Different curves can be generated depending on the type of spline used B-spline is popular B in B-spline stands for basis functions Curves of the B-spline have orders which progressively look like a line to a triangular hat to an actual curve Other splines include the cubic, Bezier, etc. T-spline is a terminated non-recursive rational B-spline This is why you see both t-spline and b-spline calculated in the same function

Spline B-spline basic functions (image from Berkeley)

Digital Filters In essence an electronic filter that is represented digitally Control systems (or system dynamics) Convert a signal to a digital signal Change the signal using a transfer function over the digital signal Implemented using a difference equation Like a Fast Fourier Transform (FFT) Used for smoothing Used for fitting While advantageous over electronic filtering due to the inherent drifts and noise, it can be very complex and lead to removal of real signal

Digital Filters There are a number of types of digital filters thought they all revolve around some form of transfer function IIR filters Infinite impulse response (delta functions) filters Dirac delta functions Mathematically ideal f x x a dx= f a Need to implement carefully around x=0 point as there is no clear definition of what that is...can do it though Typically defined carefully with a difference equation

Digital Filters There are a number of types of digital filters thought they all revolve around some form of transfer function FIR filters Finite impulse response filters Kronecker delta function δ i j =1 wheni= j δ i j =0 when i j i= Discrete analogy to Dirac delta function Implemented using difference equation Window function filter is most common f i δ i j = f j

Control Systems - filters Control systems (system dynamics) Difference equation (possible derived from a transform) equates the output to the input by a set of coefficients that filter the input Iterative process Where coefficients represent feed forward (a coefficients) and feed back (b coefficients) coefficients (recall EGR 1010 discussion of this) Equation below is for IIR, remove feedback and you have FIR i =l y n =α( i=0 j=m a i x i n b j y j) n j=1