HP 15c User Manual
Page 94

94
Section 4: Using Matrix Operations
94
n
i
i
i
F
r
w
1
2
2
2
Wr
where W is a diagonal n × n matrix with positive diagonal elements w
1
, w
2
, ... , w
n
.
Then
)
(
)
(
2
XB
y
W
W
Xb
y
Wr
T
T
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
2
2
b
F
F
X
y
r
subject to the constraints
k
j
i
j
ij
m
i
d
b
c
1
,
,
2
,
1
for
d
Cb
.
This is equivalent to finding a solution b to the augmented normal equations
d
y
X
b
C
C
X
X
T
T
T
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
.
0
0
.
0
0
.
0
2
.
0
1
.
0
1
.
0
.
000
,
100
.
000
,
100
y
X
Then
05
.
000
,
000
,
000
,
10
99
.
999
,
999
,
999
,
9
99
.
999
,
999
,
999
,
9
05
.
000
,
000
,
000
,
10
X
X
T