Presentation is loading. Please wait.

Presentation is loading. Please wait.

Curve Fitting and Interpolation: Lecture (IV)

Similar presentations


Presentation on theme: "Curve Fitting and Interpolation: Lecture (IV)"— Presentation transcript:

1 Curve Fitting and Interpolation: Lecture (IV)
Chapter 5 Curve Fitting and Interpolation: Lecture (IV) Dr. Jie Zou PHY 3320

2 Outline Least-square regression Linear (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. v (m/s) 10 20 30 40 50 60 70 80 F (N) 25 380 550 610 1220 830 1450 Best fit line: F = 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 After Dr. Jie Zou PHY 3320

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 = “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


Download ppt "Curve Fitting and Interpolation: Lecture (IV)"

Similar presentations


Ads by Google