Professional Documents
Culture Documents
GEM 803 Chapter 3 (1st Term SY2019-2020)
GEM 803 Chapter 3 (1st Term SY2019-2020)
GEM 803 Chapter 3 (1st Term SY2019-2020)
Numerical Methods
CHAPTER 3
CURVE FITTING
Curve Fitting
Curves are being fit to data essentially to obtain intermediate
estimates.
Techniques in curve fitting require the simplified version of a
complicated function by which the values of the function at a
number of discrete values along the range of interest are
computed.
Then, a simpler function may be derived to fit these values.
Both applications are known as curve fitting.
Curve Fitting
The distinction between two general approaches for curve fitting
is categorized on the basis of the amount of error associated with
the data presented.
•The data exhibits a significant degree of error or “noise”
(4) e = (y
i =1
i
i =1
i − a − bxi )
This criterion does not yield a unique best fit.
•A strategy that overcomes the disadvantages of the
aforementioned approaches is to minimize the sum of the squares
of the residuals,
n n
(5)
S = ei = ( yi − a − bxi )
2 2
i =1 i =1
Least-Square Fit of a Straight Line
In order to determine values for a and b, equation (5) is
differentiated with respect to each coefficient,
S
= −2 ( yi − a − bxi )
(6) a
S
= −2 ( yi − a − bxi )xi
b
0 = yi − a − bxi
(7)
0 = xi yi − axi − bxi
2
Least-Square Fit of a Straight Line
But a = na, the equations can be expressed as a set of two
simultaneous linear equations of two unknowns:
(6) na + bxi = yi
axi + bxi = xi yi
2
a=
y i
−b
x i
n n
Example
A study was done to determine the effect of ambient temperature x on the
electric power y consumed by a chemical plant. Other factors held constant,
and the data were collected from an experimental pilot plant.
y (BTU) x (0F) y (BTU) x (0F)
250 27 265 31
285 45 298 60
320 75 267 34
295 58 321 74
y = a0 + a1 x + a2 x 2
i =1
Nonlinear Regression
Differentiating with respect to a0, a1, and a2 and then equating
each to zero, yields the following
n n n
y
i =1
i = a0 n + a1 xi + a2 xi
i =1 i =1
2
n n n n
x y
i =1
i i = a0 xi + a1 xi + a2 xi
i =1 i =1
2
i =1
3
n n n n
x
i =1
i
2
yi = a0 xi + a1 xi + a2 xi
i =1
2
i =1
3
i =1
4
Multiple Regression
The regression may be called multiple if there are more than one
independent variable involved, the approximating the function for 2
variables x and z is of the form
y = ao + a1 x + a2 z
The values of a0, a1, and a2 are obtained using the deviation functions
and are found from the equations
n n n
y
i =1
i = a0 n + a1 xi + a2 zi
i =1 i =1
n n n n
x y
i =1
i i = a0 xi + a1 xi + a2 xi zi
i =1 i =1
2
i =1
n n n n
yi zi = a0 zi + a1 xi zi + a2 zi
i =1 i =1 i =1 i =1
2
Example 1
The following is a set of coded experimental data on the compressive
strength of a particular alloy at various values of the concentration of
some additive.
Concentration, x Compressive Strength, y
10.0 25.2 27.3 28.7
15.0 29.8 31.1 27.8
20.0 31.2 32.6 29.7
25.0 31.7 30.1 32.3
30.0 29.4 30.8 32.8
Estimate the quadratic regression curve of the form
y = 0 + 1x + 2 x2
Example 2
A study was performed on a type of bearing to find the relationship of amount of wear y
to x1 = oil viscosity and x2 = load. The following data were obtained.
y x1 x2
193 1.6 851
172 22.0 1058
113 33.0 1357
230 15.5 816
91 43.0 1201
125 40.0 1115
(a) Estimate the unknown parameters of the multiple linear regression equation
y = 0 + 1x1 + 2 x2
(a) Predict wear when oil viscosity is 20 and load is 1200.