Curve Fitting
Curve Fitting
Curve Fitting
What is Regression?
What is regression? Given n data points (x1, y1), (x 2, y 2), ... , (xn, yn)
best fit y = f (x) to the data. The best fit is generally based on
minimizing the sum of the square of the residu.als, Sr
y = f ( x)
Residual at a point is
i = y i − f (x i ) ( xn, yn )
Sum of the square of the
residuals
n
Sr = (yi − f (xi))2
i=1 ( x 1, y 1 )
Figure. Basic model for regression
7 Dr. Khaldoon Bani-Hani
Least-Squares Regression
When large error is associated with data,
polynomial interpolation is inappropriate since
it will generate the high number of order.
The best way is to sketch a best line through
the points.
minimizing x ,y
n
x ,y 3 3
2 2
ei
y = a 0 + a1 x
i=1
x ,y x
work as a criterion, where 1 1
n n n
S r = ei2 = ( yi , measured − yi , model) 2 = ( yi − a0 − a1 xi ) 2
i=1 i=1 i=1
nn ao + ( xi )a1 = yi
xi ao
2 =
yi
x a + x a (
= x )
( i )ox i a1i 1 i yi i i
y
n x − ( x ) n y − ( y )
2 2
2 2
i i i i