Lecture 29: Modeling Data. Data Modeling Interpolate between data points, using either linear or cubic spline models Model a set of data points as a polynomial.

Slides:



Advertisements
Similar presentations
Splines and Piecewise Interpolation
Advertisements

1 Chapter 13 Curve Fitting and Correlation This chapter will be concerned primarily with two separate but closely interrelated processes: (1) the fitting.
Advanced Higher STATISTICS Linear Regression To see if there is a relationship between two variables, we draw a scatter-graph. It is then possible to draw.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Chapter 15 Above: GPS time series from southern California after removing several curve fits to the data.
©1999 BG Mobasseri 15/24/99 INTERPOLATION AND CURVE FITTING Etter: pp June 16, ‘99.
Chapter 18 Interpolation The Islamic University of Gaza
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
CITS2401 Computer Analysis & Visualisation
Lecture 11 Chap. 15. Outline Interpolation – Linear Interpolation – Cubic Spline Interpolation – Extrapolation 15.2 Curve.
1cs426-winter-2008 Notes  Ian Mitchell is running a MATLAB tutorial, Tuesday January 15, 5pm-7pm, DMP 110 We won’t be directly using MATLAB in this course,
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 23 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 24 Regression Analysis-Chapter 17.
FACTOR THE FOLLOWING: Opener. 2-5 Scatter Plots and Lines of Regression 1. Bivariate Data – data with two variables 2. Scatter Plot – graph of bivariate.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 21 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
6.2 Graphs of Polynomials. The Degree of Polynomials The degree of a polynomial is the value of the largest exponent. y = 5x 4 + 3x 2 – 7 Degree = 4 y.
Correlation and regression 1: Correlation Coefficient
CMPS1371 Introduction to Computing for Engineers NUMERICAL METHODS.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
© 2008 Pearson Addison-Wesley. All rights reserved Chapter 1 Section 13-6 Regression and Correlation.
Recap Summary of Chapter 6 Interpolation Linear Interpolation.
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Polynomial Interpolation You will frequently have occasions to estimate intermediate values between precise data points. The function you use to interpolate.
Department of Mechanical Engineering, LSU Session IV MATLAB Tutorials Session IV Mathematical Applications using MATLAB Rajeev Madazhy
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Lecture 10 2D plotting & curve fitting Subplots Other 2-D Plots Other 2-D Plots Curve fitting © 2007 Daniel Valentine. All rights reserved. Published by.
Interpolation.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #15 Spline Interpolation.
April 1 st, Bellringer-April 1 st, 2015 Video Link Worksheet Link
2.5 Using Linear Models A scatter plot is a graph that relates two sets of data by plotting the data as ordered pairs. You can use a scatter plot to determine.
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
MODEL FITTING jiangyushan. Introduction The goal of model fitting is to choose values for the parameters in a function to best describe a set of data.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
Section 1.6 Fitting Linear Functions to Data. Consider the set of points {(3,1), (4,3), (6,6), (8,12)} Plot these points on a graph –This is called a.
1 Lecture 8 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 17 and 18 Interpolation.
Curve Fitting with Polynomial Models Essential Questions
P REVIEW TO 6.7: G RAPHS OF P OLYNOMIAL. Identify the leading coefficient, degree, and end behavior. Example 1: Determining End Behavior of Polynomial.
Math 495B Polynomial Interpolation Special case of a step function. Frederic Gibou.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 13.1 Interpolation between.
Matlab/Octave/FreeMat: Powerful Tools for Engineering Analysis BJ Furman 02DEC2012.
1.6 Modeling Real-World Data with Linear Functions Objectives Draw and analyze scatter plots. Write a predication equation and draw best-fit lines. Use.
MATLAB for Engineers 3E, by Holly Moore. © 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Linear Regression Essentials Line Basics y = mx + b vs. Definitions
Correlation & Forecasting
Introduction to Programming for Mechanical Engineers
Graphs & Line (Curve) of Best Fit
Linear Regression.
EEE 244-7: Curve Fitting.
Lesson 15-7 Curve Fitting Pg 842 #4 – 7, 9 – 12, 14, 17 – 26, 31, 38
Curve-Fitting Spline Interpolation
Investigating Relationships
Lecture 10 2D plotting & curve fitting
Chapter 12 Curve Fitting : Fitting a Straight Line Gab-Byung Chae
4.2 Properties of Polynomial Graphs
Spline Interpolation Class XVII.
Linear regression Fitting a straight line to observations.
Least Squares Fitting A mathematical procedure for finding the best-fitting curve to a given set of points by minimizing the sum of the squares of the.
Splines and Piecewise Interpolation
Interpolation and curve fitting
Section 1.4 Curve Fitting with Linear Models
Splines There are cases where polynomial interpolation is bad
Unit 2 Quantitative Interpretation of Correlation
Applying linear and median regression
Curve Fitting in Matlab
Homework: PG. 204 #30, 31 pg. 212 #35,36 30.) a. Reading scores are predicted to increase by for each one-point increase in IQ. For x=90: 45.98;
15.7 Curve Fitting.
Presentation transcript:

Lecture 29: Modeling Data

Data Modeling Interpolate between data points, using either linear or cubic spline models Model a set of data points as a polynomial

What is the corresponding value of y for this x? Interpolation When you take data, how do you predict what other data points might be? Two techniques are : Linear Interpolation Cubic Spline Interpolation

Linear Interpolation Assume the function between two points is a straight line How do you find a point in between? X=2, Y=? Interpolated Points Linear Interpolation – Connect the points with a straight line to find y

MATLAB Code interp1 is the MATLAB function for linear interpolation First define an array of x and y for measured data Then define a new x array, that includes the x values for which you want to find y values new_y=interp1(x,y,x_new)

plot(x, y, ‘-o’, new_x, new_y, ‘xr’) Both measured data points and interpolated data were plotted on the same graph.

Cubic Spline A cubic spline creates a smooth curve, using a third degree polynomial We can get an improved estimate by using the spline interpolation technique

Cubic Spline Interpolation. The diamond data points on the smooth curve were calculated. The star data points were measured. Note that every measured point also falls on the curved line.

Curve Fitting There is scatter in all collected data We can estimate the equation that represents the data by “eyeballing” a graph There will be points that do not fall on the line we estimate

This line is just a “best guess”

Linear Regression Finds the “best fit” straight line Minimizes the amount each point is away from the line It’s possible none of the points will fall on the line

Polynomial Regression Linear Regression finds a straight line, which is a first order polynomial If the data doesn’t represent a straight line, a polynomial of higher order may be a better fit

polyfit and polyval polyfit finds the coefficients of a polynomial representing the data polyval uses those coefficients to find new values of y, that correspond to the specified values of x

Coefficients of the first order polynomial describing the best fit line y = *x