# CGN 3421 Computer Methods Gurley Numerical Methods Lecture...

• Homework Help
• 14

This preview shows page 1 - 4 out of 14 pages.

CGN 3421 - Computer Methods Gurley Numerical Methods Lecture 5 - Curve Fitting Techniques page 86 of 99 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 H Z ( ) ± ² H Z ( ) H Z ( ) H Z ( ) Interpolation Curve Fitting f(x) = ax + b f(x) = ax + b for each line for entire range

Subscribe to view the full document.

CGN 3421 - Computer Methods Gurley Numerical Methods Lecture 5 - Curve Fitting Techniques page 87 of 99 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 H Z ( ) CZ D ³ ²
CGN 3421 - Computer Methods Gurley Numerical Methods Lecture 5 - Curve Fitting Techniques page 88 of 99 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.

Subscribe to view the full document.

You've reached the end of this preview.
• Spring '19
• Mamuli
• Gurley

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern