Lecture 15 - Curve Fitting Techniques

Similar documents
Graphs on Logarithmic and Semilogarithmic Paper

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

EQUATIONS OF LINES AND PLANES

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

Math 314, Homework Assignment Prove that two nonvertical lines are perpendicular if and only if the product of their slopes is 1.

Binary Representation of Numbers Autar Kaw

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

Reasoning to Solve Equations and Inequalities

1. Find the zeros Find roots. Set function = 0, factor or use quadratic equation if quadratic, graph to find zeros on calculator

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001

Linear Equations in Two Variables

Homework 3 Solutions

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

2 DIODE CLIPPING and CLAMPING CIRCUITS

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

Section 5-4 Trigonometric Functions

Experiment 6: Friction

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

MATH 150 HOMEWORK 4 SOLUTIONS

Vectors Recap of vectors

Or more simply put, when adding or subtracting quantities, their uncertainties add.

Factoring Polynomials

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one.

Vectors. The magnitude of a vector is its length, which can be determined by Pythagoras Theorem. The magnitude of a is written as a.

Unit 6: Exponents and Radicals

Lecture 5. Inner Product

MODULE 3. 0, y = 0 for all y

4.11 Inner Product Spaces

Vector differentiation. Chapters 6, 7

Math 135 Circles and Completing the Square Examples

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

Pure C4. Revision Notes

Pentominoes. Pentominoes. Bruce Baguley Cascade Math Systems, LLC. The pentominoes are a simple-looking set of objects through which some powerful

Exponential and Logarithmic Functions

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity

0.1 Basic Set Theory and Interval Notation

Lecture 3 Gaussian Probability Distribution

The remaining two sides of the right triangle are called the legs of the right triangle.

Firm Objectives. The Theory of the Firm II. Cost Minimization Mathematical Approach. First order conditions. Cost Minimization Graphical Approach

A.7.1 Trigonometric interpretation of dot product A.7.2 Geometric interpretation of dot product

Section 7-4 Translation of Axes

P.3 Polynomials and Factoring. P.3 an 1. Polynomial STUDY TIP. Example 1 Writing Polynomials in Standard Form. What you should learn

Radius of the Earth - Radii Used in Geodesy James R. Clynch February 2006

9 CONTINUOUS DISTRIBUTIONS

Chapter. Contents: A Constructing decimal numbers

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

Warm-up for Differential Calculus

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply?

Module 2. Analysis of Statically Indeterminate Structures by the Matrix Force Method. Version 2 CE IIT, Kharagpur

Helicopter Theme and Variations

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2

e.g. f(x) = x domain x 0 (cannot find the square root of negative values)

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

Treatment Spring Late Summer Fall Mean = 1.33 Mean = 4.88 Mean = 3.

Basically, logarithmic transformations ask, a number, to what power equals another number?

AREA OF A SURFACE OF REVOLUTION

One Minute To Learn Programming: Finite Automata

QUADRATURE METHODS. July 19, Kenneth L. Judd. Hoover Institution

Distributions. (corresponding to the cumulative distribution function for the discrete case).

Regular Sets and Expressions

Review Problems for the Final of Math 121, Fall 2014

Vectors and dyadics. Chapter 2. Summary. 2.1 Examples of scalars, vectors, and dyadics

Algebra Review. How well do you remember your algebra?

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation

Small Business Networking

1.2 The Integers and Rational Numbers

Integration by Substitution

CUBIC-FOOT VOLUME OF A LOG

Multiplication and Division - Left to Right. Addition and Subtraction - Left to Right.

6.2 Volumes of Revolution: The Disk Method

APPLICATION NOTE Revision 3.0 MTD/PS-0534 August 13, 2008 KODAK IMAGE SENDORS COLOR CORRECTION FOR IMAGE SENSORS

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

Integration. 148 Chapter 7 Integration

Lec 2: Gates and Logic

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University

Answer, Key Homework 10 David McIntyre 1

Brillouin Zones. Physics 3P41 Chris Wiebe

Lectures 8 and 9 1 Rectangular waveguides

Review guide for the final exam in Math 233

COMPONENTS: COMBINED LOADING

Welch Allyn CardioPerfect Workstation Installation Guide

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

MA Lesson 16 Notes Summer 2016 Properties of Logarithms. Remember: A logarithm is an exponent! It behaves like an exponent!

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 16 th May Time: 14:00 16:00

Repeated multiplication is represented using exponential notation, for example:

Rotational Equilibrium: A Question of Balance

15.6. The mean value and the root-mean-square value of a function. Introduction. Prerequisites. Learning Outcomes. Learning Style

Basic Analysis of Autarky and Free Trade Models

, and the number of electrons is -19. e e C. The negatively charged electrons move in the direction opposite to the conventional current flow.

19. The Fermat-Euler Prime Number Theorem

Cypress Creek High School IB Physics SL/AP Physics B MP2 Test 1 Newton s Laws. Name: SOLUTIONS Date: Period:

Introduction. Teacher s lesson notes The notes and examples are useful for new teachers and can form the basis of lesson plans.

Small Business Networking

Angles 2.1. Exercise Find the size of the lettered angles. Give reasons for your answers. a) b) c) Example

LECTURE #05. Learning Objective. To describe the geometry in and around a unit cell in terms of directions and planes.

Summary: Vectors. This theorem is used to find any points (or position vectors) on a given line (direction vector). Two ways RT can be applied:

Applications to Physics and Engineering

10.6 Applications of Quadratic Equations

Transcription:

Lecture 15 - Curve Fitting Techniques Topics curve fitting motivtion liner regression Curve fitting - motivtion For root finding, we used given function to identify where it crossed zero where does fx ( ) 0?? Q: Where does this given function f( x) come from in the first plce? Anlyticl models of phenomen (e.g. equtions from physics) Crete n eqution from oserved dt 1) Interpoltion (connect the dt-dots) If dt is relile, we cn plot it nd connect the dots This is piece-wise, liner interpoltion This hs limited use s generl function f( x) Since its relly group of smll f( x) s, connecting one point to the next nd, it doesn t work very well for dt tht hs uilt in rndom error ) Curve fitting - cpturing the trend in the dt Let s drw line through the dt f(x) x + Interpoltion Curve Fitting A stright line is descried genericlly y f(x) x + The gol is to identify the coefficients nd such tht f(x) fits the dt Lecture 15 - Curve Fitting Techniques pge 13 of 19

other exmples height of dropped oject Oxygen in soil pore pressure time Profit temperture soil depth pid lor hours Is stright line suitle for ech of these cses? No. But we re not stuck with just stright line fits. Tht is just where we ll strt. Liner curve fitting (liner regression) Given the generl form of stright line????? f( x) x + How cn we pick the coefficients tht est fits the line to the dt? First question: Wht mkes prticulr stright line good fit? Why does the lue line pper to us to fit the trend etter? Consider the distnce etween the dt nd points on the line Add up the length of ll the red nd lue verticle lines This is n expression of the error etween line nd dt The one line tht provides minimum error is then the est stright line Lecture 15 - Curve Fitting Techniques pge 14 of 19

Quntifying error in curve fit ssumptions: 1) positive or negtive error hve the sme error vlue (dt point is ove or elow the line) ) Weigh greter errors more hevily we cn do oth of these things y squring the distnce denote dt vlues s (x, y) >> denote points on the line s (x, f(x)) sum the error t the four dt points (x,y ) (x 4,y 4 ) (x,f(x )) (x 4,f(x 4 )) err ( d i ) ( y 1 fx ( 1 )) + ( y fx ( )) + ( y 3 fx ( 3 )) + ( y 4 fx ( 4 )) now sustitute f( x) x + # dt points # dt points err ( y i fx ( i )) ( y i ( x i + ) ) i 1 i 1 find the est line minimize the error etween line nd dt points This is clled the lest squres pproch, since we minimize the squre of the error. # dt points n minimize err ( y i ( x i + ) )???????????????????? i 1 time to pull out the clculus... finding the minimum of function 1) derivtive descries the slope ) slope zero is minimum > tke the derivtive with respect to nd, set ech to zero Lecture 15 - Curve Fitting Techniques pge 15 of 19

Find nd so tht these two equtions oth 0 re-write these two equtions x i + x i put these into mtrix form n err ---------- x i ( y i x i ) 0 i 1 n err ---------- y ( i x i ) 0 i 1 ( x i y i ) x + *n y i i????????????? n x i x i x i y i ( x i y ) i wht s unknown? we hve the dt points ( x i, y i ) for i 1,..., n so unknows re nd Good news, we lredy know how to solve this prolem rememer Gussin elimintion?? A n x i, X, B x i x i so AX B y i ( x i y ) i using uilt in MATLAB mtrix inversion, the coefficients nd re solved >> X inv(a)*b?????? Note: A, B, nd X re not the sme s,, nd x Let s test this with n exmple: Lecture 15 - Curve Fitting Techniques pge 16 of 19

Here s some dt i 1 3 4 5 6 x y 0 0.5 1.0 1.5.0.5 0 1.5 3.0 4.5 6.0 7.5 n 6 x i 7.5, y i.5 x i 13.75, x i y i 41.5 Plugging into the mtrix form gives us: 6 7.5 7.5 13.75.5 Note: we re using x, NOT 41.5 i ( x i ) inv 6 7.5 7.5 13.75 *.5 41.5 or use Gussin elimintion... The solution is 0 > f( x) 3x + 0 3 This fits the dt exctly. Tht is, the error is zero. Usully this is not the outcome. Usully we hve dt tht does not exctly fit stright line. here s n exmple with some noisy dt x [0.5 1 1.5.5] y [-0.436-0.1656 3.153 4.7877 4.8535 8.6909] 6 7.5 7.5 13.75 0.8593 41.6584 inv 6 7.5 7.5 13.75 * 0.8593 41.6584 Lecture 15 - Curve Fitting Techniques pge 17 of 19

0.975 3.561 so our fitted curve is f( x) 4.15 x.05 Here s plot of the dt nd the curve fit: Lecture 15 - Curve Fitting Techniques pge 18 of 19

So...wht do we do when stright line is not suitle model? Profit pid lor hours Stright line will not predict diminishing returns tht dt shows We strted the liner curve fit y choosing generic form of the stright line f(x) x + This is just one kind of function. There re n infinite numer of generic forms we could choose from for lmost ny shpe we wnt. Let s strt with simple extension to the liner regression concept Lecture 15 - Curve Fitting Techniques pge 19 of 19