Singular and nearly singular matrices – HP 15c User Manual

Page 98

Advertising
background image

98

Section 4: Using Matrix Operations

98

columns in the original data and refactor the weighted constraint equations. Repeat this
procedure if necessary.

For example, if the factorization of wC gives

2

.

1

5

.

1

5

.

2

0

0

1

.

0

0

.

3

5

.

0

02

.

0

0

3

.

0

5

.

1

5

.

0

0

.

2

0

.

1

U

,

then the second diagonal element is much smaller than the value 2.0 above it. This indicates
that the first and second columns in the original constraints are nearly dependent. The
diagonal element is also much smaller than the subsequent value 3.0 in its row. Then the
second and fourth columns should be swapped in the original data and the factorization
repeated.

It is always prudent to check for consistent constraints. The test for small diagonal elements
of U can be done at the same time.

Finally, using U and g as the first k rows, add rows corresponding to X and y. (Refer to
Least-Squares Using Successive Rows on page 118 for additional information.) Then solve
the unconstrained least-squares problem with

y

d

y

X

C

X

w

w

and

.

Provided the calculated solution b satisfies ||Cbd|| < t, that solution will also minimize ||y
Xb|| subject to the constraint Cbd.

Singular and Nearly Singular Matrices

A matrix is singular if and only if its determinant is zero. The determinant of a matrix is
equal to (−1)

r

times the product of the diagonal elements of U, where U is the upper-diagonal

matrix of the matrix's LU decomposition and r is the number of row interchanges in the
decomposition. Then, theoretically, a matrix is singular if at least one of the diagonal
elements of U, the pivots, is zero; otherwise it is nonsingular.

However, because the HP-15C performs calculations with only a finite number of digits,
some singular and nearly singular matrices can't be distinguished in this way. For example,
consider the matrix

LU

B

0

0

3

3

1

0

1

1

1

3

3

3

1

,

which is singular. Using 10-digit accuracy, this matrix is decomposed as

Advertising