You are on page 1of 19

CURVE FITTING

Part 5
Describes techniques to fit curves (curve fitting) to discrete
data to obtain intermediate estimates.

There are two general approaches two 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.

by Lale Yurttas, T Chapter 17 1


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure PT5.1

by Lale Yurttas, T Chapter 17 2


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Mathematical Background
Simple Statistics/
In course of engineering study, if several
measurements are made of a particular quantity,
additional insight can be gained by summarizing the
data in one or more well chosen statistics that convey
as much information as possible about specific
characteristics of the data set.
These descriptive statistics are most often selected to
represent
The location of the center of the distribution of the data,
The degree of spread of the data.
by Lale Yurttas, T Chapter 17 3
exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Arithmetic mean. The sum of the individual data
points (yi) divided by the number of points (n).

y
y i

n
i 1, , n

Standard deviation. The most common measure of a


spread for a sample.

y y
2
St 2
/n
Sy or i i
n 1 S 2
y
n 1
S t ( yi y ) 2

by Lale Yurttas, T Chapter 17 4


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Variance. Representation of spread by the square of
the standard deviation.

S y2
i
( y y ) 2

Degrees of freedom
n 1

Coefficient of variation. Has the utility to quantify the


spread of data.
Sy
c.v. 100%
y

by Lale Yurttas, T Chapter 17 5


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure PT5.2

by Lale Yurttas, T Chapter 17 6


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure PT5.3

by Lale Yurttas, T Chapter 17 7


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Least Squares Regression
Chapter 17
Linear Regression
Fitting a straight line to a set of paired
observations: (x1, y1), (x2, y2),,(xn, yn).
y=a0+a1x+e
a1- slope
a0- intercept
e- error, or residual, between the model and the
observations
by Lale Yurttas, T Chapter 17 8
exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Criteria for a Best Fit/
Minimize the sum of the residual errors for all
available data:
n n

e (y
i 1
i
i 1
i ao a1 xi )

n = total number of points


However, this is an inadequate criterion, so is the sum
of the absolute values
n n

e y
i 1
i
i 1
i a0 a1 xi

by Lale Yurttas, T Chapter 17 9


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 17.2

by Lale Yurttas, T Chapter 17 10


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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:
n n n
S r ei2 ( yi , measured yi , model) 2 ( yi a0 a1 xi ) 2
i 1 i 1 i 1

Yields a unique line for a given set of data.

by Lale Yurttas, T Chapter 17 11


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Least-Squares Fit of a Straight Line/
S r
2 ( yi ao a1 xi ) 0
ao
S r
2 ( yi ao a1 xi ) xi 0
a1
0 yi a 0 a1 xi
0 yi xi a 0 xi a1 xi2

a 0 na0 Normal equations, can be


na0 xi a1 yi solved simultaneously

n xi yi xi yi
a1
n x xi
2 2
i Mean values
by Lale Yurttas, T Chapter 17 12
a
exas
y a 1 x
0 A&M Universit Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 17.3

by Lale Yurttas, T Chapter 17 13


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 17.4

by Lale Yurttas, T Chapter 17 14


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 17.5

by Lale Yurttas, T Chapter 17 15


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Goodness of our fit/
If
Total sum of the squares around the mean for the
dependent variable, y, is St
Sum of the squares of residuals around the regression
line is Sr
St-Sr quantifies the improvement or error reduction
due to describing data in terms of a straight line rather
than as an average value.
St S r
r 2

St
r2-coefficient of determination
by Lale Yurttas, T Sqrt(r2) correlation coefficient 16
exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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.

by Lale Yurttas, T Chapter 17 17


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Polynomial Regression
Some 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 (Sec. 17.2).

by Lale Yurttas, T Chapter 17 18


exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
General Linear Least Squares
y a0 z0 a1 z1 a2 z 2 am z m e
z0 , z1, , z m are m 1 basis functions
Y Z A E
Z matrix of the calculated values of the basis functions
at the measured values of the independent variable
Y observed valued of the dependent variable
A unknown coefficients
E residuals
2 Minimized by taking its partial
n m
S r yi a j z ji derivative w.r.t. each of the
coefficients and setting the
i 1 j 0 resulting equation equal to zero
by Lale Yurttas, T Chapter 17 19
exas A&M UniversitCopyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

You might also like