che 555 curve fitting

28
by Lale Yurttas, Texas A&M University Chapter 4 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 4 CURVE FITTING

Upload: norizzatul-akmal

Post on 30-Sep-2015

44 views

Category:

Documents


3 download

DESCRIPTION

numec chapter 4

TRANSCRIPT

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.Chapter 4CURVE FITTING

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*CURVE FITTINGDescribes techniques to fit curves (curve fitting) to discrete data to obtain intermediate estimates.

    There are two general approaches for curve fitting:Data exhibit a significant degree of scatter. The strategy is to derive a single curve that represents the general trend of the data.Data is very precise. The strategy is to pass a curve or a series of curves through each of the points.

    In engineering two types of applications are encountered:Trend analysis. Predicting values of dependent variable, may include extrapolation beyond data points or interpolation between data points.Hypothesis testing. Comparing existing mathematical model with measured data.

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Arithmetic mean. The sum of the individual data points (yi) divided by the number of points (n).

    Standard deviation. The most common measure of a spread for a sample.

    orMATHEMATICAL BACKGROUND

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Variance. Representation of spread by the square of the standard deviation.

    Coefficient of variation. Has the utility to quantify the spread of data.

    Degrees of freedom

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*LINEAR REGRESSIONFitting a straight line to a set of paired observations: (x1, y1), (x2, y2),,(xn, yn).where: a1- slopea0- intercepte- error, or residual, between the model and the observationsMean values

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Criteria for a Best FitMinimize the sum of the residual errors for all available data:

    n = total number of pointsHowever, this is an inadequate criterion.Minimize the sum of the absolute values:

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Minimizes the sum of residuals

    Minimizes the sum of absolute values of residuals

    Minimizes the max error of any individual point

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Best strategy is to minimize the sum of the squares of the residuals between the measured y and the y calculated with the linear model:

    Yields a unique line for a given set of data.

    Standard error of the estimate, Sy/x:

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Figure 17.3

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*Linear regression with small residual errors

    Linear regression with large residual errors

    Chapter 4

  • by Lale Yurttas, Texas A&M University*Estimation of ErrorsSt-Sr quantifies the improvement or error reduction due to describing data in terms of a straight line rather than as an average value.

    For a perfect fit:Sr=0 and r=r2=1, signifying that the line explains 100 percent of the variability of the data.For r=r2=0, Sr=St, the fit represents no improvement.r2 -coefficient of determinationr correlation coefficientChapter 4

    Chapter 4

  • Example 1Fit a straight line to the x and y values in table 1. Then compute the total standard deviation, standard error of the estimate and the correlation coefficient for the databy Lale Yurttas, Texas A&M UniversityChapter 4*Table 1

    xiyi10.522.532.044.053.566.075.5

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*POLYNOMIAL REGRESSIONSome engineering data is poorly represented by a straight line. For these cases a curve is better suited to fit the data. The least squares method can readily be extended to fit the data to higher order polynomials.For example: 2nd order polynomial

    Chapter 4

  • Set of normal equations:

    In matrix form:

    by Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Standard error:

    Where: m = m-th order polynomialby Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Example 2Fit a second-order polynomial to the x and y values in table 2. Then compute the total standard deviation, standard error of the estimate and the correlation coefficient for the data.by Lale Yurttas, Texas A&M UniversityChapter 4*Table 2

    xiyi02.117.7213.6327.2440.9561.1

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*MULTIPLE LINEAR REGRESSIONUseful extension of linear regression in case where y is a linear function of 2 or more independent variables.For example:

    Chapter 4

  • Set of normal equations:

    In matrix form:

    by Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Standard error:

    Where: m = dimension

    by Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Example 3The data from table 3 was calculated from the equationy = 5 + 4x1 3x2. Use multiple linear regression to fit this data.by Lale Yurttas, Texas A&M UniversityChapter 4*Table 3

    x1x2y00521102.5291304637227

    Chapter 4

  • by Lale Yurttas, Texas A&M UniversityChapter 4*GENERAL LINEAR LEAST SQUARESGeneral model:

    Express in matrix form:

    Chapter 4

  • Outcome / Solution to this model:

    Equivalent to the normal equation developed previously3 solution technique: (i) Gauss Elimination; (ii) Choleskys ; (iii) matrix inverse

    Sum squares of the residuals:by Lale Yurttas, Texas A&M UniversityChapter 4*Minimized by taking its partial derivative with respect to each of the coefficients and setting the resulting equation equal to zero

    Chapter 4

  • NONLINEAR REGRESSIONIn engineering many cases where nonlinear model must be fit to data.General equation:

    For example:

    Gauss Newton method algorithm for minimizing the sum of squares of residual between data and nonlinear equations.by Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • ProceduresLinearized the original model with respect to the parameter (e.g. : 2 parameter)

    In matrix form:by Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Where:by Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Applying linear least square theory; solve {A}

    Improve values of parameters:

    Repeated until the solution converges falls below an acceptable stopping criterion.

    by Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Sum of squares of the residualsby Lale Yurttas, Texas A&M UniversityChapter 4*

    Chapter 4

  • Example 4Fit the function

    to data in table 4. Use initial guesses of a0 = 1.0 and a1 = 1.0 for the parameters.by Lale Yurttas, Texas A&M UniversityChapter 4*Table 4

    xiyi0.250.280.750.571.250.681.750.742.250.79

    Chapter 4