User Manual

94 Section 4: Using Matrix Operations
94
n
i
ii
F
rw
1
22
2
Wr
where W is a diagonal n × n matrix with positive diagonal elements w
1
, w
2
, ... , w
n
.
Then
)()(
2
XByWWXbyWr
TT
F
and any solution b also satisfies the weighted normal equations
X
T
W
T
WXb = X
T
W
T
Wy.
These are the normal equations with X and y replaced by WX and Wy. Consequentially,
these equations are sensitive to rounding errors also.
The linearly constrained least-squares problem involves finding b such it minimizes
22
b
FF
Xyr
subject to the constraints
k
j
ijij
midbc
1
,,2,1for dCb
.
This is equivalent to finding a solution b to the augmented normal equations
d
yX
b
C
CXX
TTT
1
0
where l, a vector of Lagrange multipliers, is part of the solution but isn't used further. Again,
the augmented equations are very sensitive to rounding errors. Note also that weights can
also be included by replacing X and y with WX and Wy.
As an example of how the normal equations can be numerically unsatisfactory for solving
least-squares problems, consider the system defined by
.
1.0
1.0
1.0
1.0
and
2.00.0
0.02.0
1.01.0
.000,100.000,100
yX
Then
05.000,000,000,1099.999,999,999,9
99.999,999,999,905.000,000,000,10
XX
T