Graphics Programs Reference
In-Depth Information
are the mean values of the x and y data. The solution for the parameters is
y x i
x x i y i
x i y i
nxy
a
=
x i
b
=
x i
(3.18)
n x 2
n x 2
These expressions aresusceptible to roundoff errors (the twoterms in each numerator
as well as in each denominator can be roughly equal). It is better to compute the
parametersfrom
y i ( x i
x )
x i ( x i
b
=
a
=
y
xb
(3.19)
x )
which areequivalenttoEqs. (3.18), but much less affectedbyrounding off.
Fitting Linear Forms
Consider the least-squares fit of the linear form
m
f ( x )
=
a 1 f 1 ( x )
+
a 2 f 2 ( x )
+···+
a m f m ( x )
=
a j f j ( x )
(3.20)
j
=
1
whereeach f j ( x ) is apredetermined function of x ,calleda basis function .Substitution
into Eq. (3.13) yields
y i
a j f j ( x i ) 2
n
m
S
=
(a)
i
=
1
j
=
1
Thus Eqs. (3.14) are
2 n
y i
a j f j ( x i ) f k ( x i )
m
S
a k =−
=
0, k
=
1
,
2
,...,
m
i
=
1
j
=
1
Dropping the constant (
2 ) and interchanging the order of summation, we get
n
f j ( x i ) f k ( x i ) a j =
m
n
f k ( x i ) y i , k
=
1
,
2
,...,
m
j
=
1
i
=
1
i
=
1
Inmatrix notation these equations are
Aa
=
b
(3.21a)
where
n
n
A kj =
f j ( x i ) f k ( x i )
b k =
f k ( x i ) y i
(3.21b)
i
=
1
i
=
1
Equations(3.21a), known as the normal equations of the least-squares fit, can be
solvedwith any of the methods discussedinChapter2.Note that the coefficient
matrix issymmetric, i.e., A kj
=
A jk .
Search WWH ::




Custom Search