1 / 9

Chapter 5

Chapter 5. Curve Fitting and Interpolation: Lecture (IV). Outline. Least-square regression Introduction-What is regression? When do we use it? Linear (least-square) regression What is linear regression? What is “least-square”? Accuracy of linear regression. Introduction. Regression

ahmed-lott
Télécharger la présentation

Chapter 5

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. Chapter 5 Curve Fitting and Interpolation: Lecture (IV) Dr. Jie Zou PHY 3320

  2. Outline • Least-square regression • Introduction-What is regression? When do we use it? • Linear (least-square) regression • What is linear regression? • What is “least-square”? • Accuracy of linear regression Dr. Jie Zou PHY 3320

  3. Introduction • Regression • What is it? - To derive an approximating function or curve that represents the general trend of the data. The curve does not necessarily pass through all the data points. • When do we use it? - Usually used when the data appear to have significant error. Linear regression Non-linear regression Dr. Jie Zou PHY 3320

  4. Linear least-square regression • Linear regression: Fit a “best” line to the data. • Fitting function: y = a0 + a1x • Parameters a0 and a1 are to be determined. • Residual error: • ei = yi – a0 – a1xi, i= 1, 2, … • ei: residual error at each data point • Least-square criterion for a “best” fit: • Minimize with respect to the parameters a0 and a1. Residual error Inadequate criterion: Minimize Dr. Jie Zou PHY 3320

  5. Derivation of the linear least-square regression • Best straight line: y = a0 + a1x • Determine a0 and a1: Apply the least-square criterion • Minimize with respect to a0 and a1 • Set • Solve the simultaneous linear equations for a0 and a1: Dr. Jie Zou PHY 3320

  6. Example: Linear regression • Use least-square regression, fit a straight line to the values in the table below. Best fit line: F = -234.2857 + 19.47024 v Dr. Jie Zou PHY 3320

  7. Accuracy of linear regression • To quantify the “goodness” of our fit: • The residual error before regression: • The residual error after regression: • The difference between S0 and S provides a measure of the accuracy of regression or the extent of improvement achieved by the least-square fit. • Correlation coefficient: • A good least-square fit is indicated by a large value or r; rmax = 1.0. Before Dr. Jie Zou PHY 3320 After

  8. Example: Correlation coefficient • In the previous example on Slide #6, calculate the correlation coefficient r for the best fit line. • Answer: r = (0.8805)1/2 = 0.9383 • “These results indicate that 88.05% of the original uncertainty has been explained by the linear model” (textbook by Chapra, p. 299). Dr. Jie Zou PHY 3320

  9. Implementation on a computer • For the example on Slide #6, write an M-file, Mylinearregression.m, to find the best fit line using the method of least-squares. • Plot the original discrete data points (in open circles) and the best fit line on the same figure. Dr. Jie Zou PHY 3320

More Related