1 / 17

Data Modeling: Interpolation Techniques for Predicting Missing Data Points

Learn how to interpolate between data points using linear or cubic spline models, and how to model a set of data points as a polynomial interpolation. Explore techniques such as linear interpolation, cubic spline interpolation, linear regression, and polynomial regression.

karriec
Download Presentation

Data Modeling: Interpolation Techniques for Predicting Missing Data Points

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 29: Modeling Data

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

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

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

  5. 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)

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

  7. 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

  8. 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.

  9. 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

  10. This line is just a “best guess”

  11. 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

  12. 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

  13. 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

  14. Coefficients of the first order polynomial describing the best fit line y = -2.9143*x +14.2857

More Related