Curve Fitting: Instructor: Dr. Aysar Yasin Dep. of Energy and Env. Engineering
Curve Fitting: Instructor: Dr. Aysar Yasin Dep. of Energy and Env. Engineering
Curve Fitting: Instructor: Dr. Aysar Yasin Dep. of Energy and Env. Engineering
e= y-a0-a1x
e- error, or residual, between the model and the
observations
Eng. Muhannad Al-Jabi
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
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
n xi yi xi yi
a1
n x xi
2 2
i Mean values
a0 y a1 x
St r2-coefficient of determination
r– correlation coefficient
n xi yi xi yi
1 0.5 1 0.5
a1 2 2.5
n x xi
2 4 5
2
i 3 2 9 6
4 4
a0 y a1 x 16 16
5 3.5 25 17.5
6 6 36 36
7 5.5 49 38.5
28 24 140 119.5
4 3.428
7(119.5) 28(24)
a1 0.8392
7(140) (28) 2
X y 2 )y-yavg(
1 0.5 8.576531
2 2.5 0.862245
3 2 2.040816
4 4 0.326531
5 3.5 0.005102
6 6 6.612245
7 5.5 4.290816
Avg(y)=3.428 22.71429
St S r
r
2
St
22.71429 2.991071
r
2
0.868
22.71429
Sr
Sy/x
n2
2.9911
Sy/x 0.7735
72
X 6 15 23 30 39 113
Y 29 14 7 13 3 66
X *Y
174 210 161 390 117 1052
X2
36 225 529 900 1521 3211
5 *1052 113 * 66
a1 0.6689
5 * 3211 113 2