Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fitting Equations to Data Chapter 7. Problems Classwork: 7.1, 7.8, 7.13, 7.22 Homework: 7.2, 7.9, 7.16, 7.23, 7.28.

Similar presentations


Presentation on theme: "Fitting Equations to Data Chapter 7. Problems Classwork: 7.1, 7.8, 7.13, 7.22 Homework: 7.2, 7.9, 7.16, 7.23, 7.28."— Presentation transcript:

1 Fitting Equations to Data Chapter 7

2 Problems Classwork: 7.1, 7.8, 7.13, 7.22 Homework: 7.2, 7.9, 7.16, 7.23, 7.28

3 Introduction Engineers look at fitting equations to data. The data is paired-value (has an X and a Y). Want to understand the characteristics of an object or system. Data may include spatial variation, time history, cause-and-effect relationships, system output as a function of a changing input parameter. If we want to know a value that was NOT obtained during the data collection, we usually graph the data, fit an equation (line, quadratic, square root, exponential decay, etc) through the data, and then use that equation to find other values.

4 Introduction – con’t Data usually exhibits scatter due to fluctuations in measurements or error. You need to decide upon the BEST form of an equation to use to describe your data. Usually you fit the curve through the aggregate of the data, rather than all the individual data points. You also have to consider if a data point is an outlier (and to be discarded) or not. The METHOD OF LEAST SQUARES answers this question. AKA LINEAR REGRESSION.

5 Linear Interpolation Used when there are only two data points. Used when the aggregate data clearly define a line and the scatter is small. Based upon finding the slope and intercept of a line using two data points and the POINT-SLOPE method. Given two data points (x 1, y 1 ), (x 2, y 2 ), the equation of the line between the two points passing through is: Y= y 1 + (y 2 -y 1 )(x 2 -x 1 )/(x-x 1 )

6 Linear Interpolation Example: Given the two points (-2, 7) and (5,0), find the value at x=-1 and x=3. Step 1. Find the equation of the line. Y=-x+5. Step 2. For x=-1, y=6. For x=3, y=2. Works fine for two points.

7 Linear Interpolation – con’t You can also use the Excel FORECAST function. Form is FORECAST (x, range of known y-values, range of known x- values), where x is the value you are interpolating for to find the associated y-value. The range of known values are the values that bracket the choisen x-value. Do Problem 7-1 as Classwork.

8 Methods of Least Squares (Sec 7.2 and 7.3) If a lot of scatter, then use a trendline and method of least squares (LINEAR REGRESSION). Used when you are working with measured data. Process wants the line to pass through as many of the data points as possible while at the same time MINIMIZING the distance from the line to the other points. The distance of the line to the actual data point is known as the error, and the method of least squares seeks to minimize the sum of the square of the errors. Works for lines and other types of equations.

9 Least Squares Curve Fitting in EXCEL – Sec 7.4 The process of fitting a regression line (least squares) is lengthy and tedious and involves the use of partial derivatives. YUCK! You can learn this in your ENGR Statistics course later. Excel lets you fit a TRENDLINE to a given set of data. Options (functions) include: Exponential, Linear, Logarithmic, Polynomial (degree 2 or higher), Power, Moving Average

10 Fitting a Regression Line Enter the data. Plot as an x-y Graph. Do not connect the data points. Right-click on a data point (data set is active), then choose ADD TRENDLINE. OR, if the graph is active, click on Layout tab and select ADD TRENDLNE from the ANALYSIS group. Specify the type of curve and any other options. Usually is good to select the equation of the curve and the associated curve fit error known as r 2 value. Can force the curve through a specific value and can extrapolate forward or backward. Does NOT provide the SSE (sum of square of errors)

11 Regression Analysis Enter the data. Select Data Analysis/Regression for the Analysis group in the Ribbon Data tab. Choose the type of trendline to use. Look at the r 2 and the SS (want r 2 near 1, SS near 0). Fix up the graph. Input the data point(s) that you wish to find data for using the regression equation.

12 How Do I Choose Which Regression FN to Use? NO SIMPLE ANSWER. Choose based upon underlying theory. Try to plot as a straight line. Look at graph and BOTH the SSE and r 2 value. Try different types of curves. Try using different scales such as x vs 1/y or 1/x vs y based upon some knowledge of the process being studied. Try scaling the data so the magnitude of the x values is about the same as the magnitude of the y values.

13 Regression Analysis Do Problems 7.8, 7.13, and 7.22 for CW. Homework for Chapter 7 is: 7.2, 7.9, 7.16, 7.23, 7.28


Download ppt "Fitting Equations to Data Chapter 7. Problems Classwork: 7.1, 7.8, 7.13, 7.22 Homework: 7.2, 7.9, 7.16, 7.23, 7.28."

Similar presentations


Ads by Google