University of Palestine Gaza Strip Civil Engineering College Numerical Analysis CIVL 3309 Dr. Suhail Lubbad
University of Palestine Gaza Strip Civil Engineering College Numerical Analysis CIVL 3309 Dr. Suhail Lubbad
University of Palestine Gaza Strip Civil Engineering College Numerical Analysis CIVL 3309 Dr. Suhail Lubbad
Gaza Strip
Find a simple yet the best curve that fits the data
points.
∑ e =∑ )y
Sr =
2
i i , measured
2
− y i , model * =∑ )y − a − a x *
i 0 1 i
2
Sr = ∑ 2
ei = ∑ 2
∑
) y i , measured − yi , model * =
2
) yi − a0 − a 1 xi *
i=1 i=1 i=1
n n
= −2 ∑ ∑
∂ Sr ∂ Sr
)y i − a0 − a1 x i * = 0, = −2 ) yi − a 0 − a1 xi * x i = 0
∂ a0 ∂ a1
i=1 i=1
a1 =
n ∑ xi y i − ∑x∑i yi
2
n ∑ x
2
i − )∑ x *i
a 0 = y( − a 1 x(
( is the mean of Q
where Q
Therefore, the least-squares fit is
y = 0.07142857 + 0.8392857x
Error analysis:
Least-Squares Fit of a Straight Line
'
Sr
S y /x =
n−2
'
n
∑
2
) y i − y( *
'
St i=1
Sy = =
n−1
n−1
St − Sr,
quantifies the improvement or error reduction due to
describing the data in terms of a straight line rather than as
an average value.
r2 : coefficient of determination
2
St − S r
r =
St
A perfect fit: Sr = 0 and r = r2 = 1, signifies that the line explains 100% of
the variability of the data.
Good Luck