NM5_curve_s02 - CGN 3421 - Computer Methods Gurley...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CGN 3421 - Computer Methods Gurley Numerical Methods Lecture 5 - Curve Fitting Techniques page 89 of 102 Numerical Methods Lecture 5 - Curve Fitting Techniques Topics motivation interpolation linear regression higher order polynomial form exponential form Curve fitting - motivation For root finding, we used a given function to identify where it crossed zero where does ?? Q: Where does this given function come from in the first place? Analytical models of phenomena (e.g. equations from physics) Create an equation from observed data 1) Interpolation (connect the data-dots) If data is reliable, we can plot it and connect the dots This is piece-wise, linear interpolation This has limited use as a general function Since its really a group of small s, connecting one point to the next it doesn’t work very well for data that has built in random error (scatter) 2) Curve fitting - capturing the trend in the data by assigning a single function across the entire range. The example below uses a straight line function A straight line is described generically by f(x) = ax + b The goal is to identify the coefficients ‘a’ and ‘b’ such that f(x) ‘fits’ the data well ! " () ! " ! " ! " ! " Interpolation Curve Fitting f(x) = ax + b f(x) = ax + b for each line for entire range
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CGN 3421 - Computer Methods Gurley Numerical Methods Lecture 5 - Curve Fitting Techniques page 90 of 102 other examples of data sets that we can fit a function to. Is a straight line suitable for each of these cases ? No. But we’re not stuck with just straight line fits. We’ll start with straight lines, then expand the concept. Linear curve fitting (linear regression) Given the general form of a straight line How can we pick the coefficients that best fits the line to the data? First question: What makes a particular straight line a ‘good’ fit? Why does the blue line appear to us to fit the trend better? Consider the distance between the data and points on the line Add up the length of all the red and blue verticle lines This is an expression of the ‘error’ between data and fitted line The one line that provides a minimum error is then the ‘best’ straight line time height of dropped object Oxygen in soil temperature soil depth pore pressure Profit paid labor hours ! " () #" $ # "
Background image of page 2
CGN 3421 - Computer Methods Gurley Numerical Methods Lecture 5 - Curve Fitting Techniques page 91 of 102 Quantifying error in a curve fit assumptions: 1) positive or negative error have the same value (data point is above or below the line) 2) Weight greater errors more heavily we can do both of these things by squaring the distance denote data values as (x, y) ==============>> denote points on the fitted line as (x, f(x)) sum the error at the four data points Our fit is a straight line, so now substitute The ‘best’ line has minimum error between line and data points This is called the least squares approach , since we minimize the square of the error.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

NM5_curve_s02 - CGN 3421 - Computer Methods Gurley...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online