Dataplot Vol 2 Vol 1

# MATRIX CONDITION NUMBER

Name:
MATRIX CONDITION NUMBER (LET)
Type:
Let Subcommand
Purpose:
Compute the condition number (or the reciprocal of the condition number) of a matrix.
Description:
The determinant, the matrix inverse, and the solution to a system of equations are all closely related. Each of these can be calculated from the LU decomposition of a matrix.

For each of these, the condition number gives a bound on the accuracy that can be obtained (this does not include the effects of round-off error, algorithm choice, or the floating point accuracy of the computer) for finding the matrix inverse, the determinant, or solving a system of equations.

A rule of thumb is that if the condition number is approximately 10d then the elements of the LU decomposed matrix generally have d fewer significant digits than the original matrix.

A matrix with high condition numbers are referred to as ill-conditioned matrix and a matrix with a low condition number is referred to a well-conditioned matrix.

Some analysts prefer to use the reciprocal of the condition number (see Syntax 2 below).

Syntax 1:
LET <par> = MATRIX CONDITION NUMBER <mat1>
<SUBSET/EXCEPT/FOR qualification>
where <mat1> is a matrix for which the condition number is to be computed;
<par> is a parameter where the resulting condition number is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional (and rarely used in this context).
Syntax 2:
LET <par> = MATRIX RECIPROCAL CONDITION NUMBER <mat1>
<SUBSET/EXCEPT/FOR qualification>
where <mat1> is a matrix for which the reciprocal of the condition number is to be computed;
<par> is a parameter where the resulting reciprocal of the condition number is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional (and rarely used in this context).
Examples:
LET C = MATRIX CONDITION NUMBER A
LET C = MATRIX RECIPROCAL CONDITION NUMBER A
Note:
Matrices for which a condition number is to be computed must have the same number of rows and columns. An error message is printed if they do not.
Note:
Matrices are created with either the READ MATRIX, CREATE MATRIX, or the MATRIX DEFINITION command. Enter HELP READ MATRIX, HELP CREATE MATRIX, or HELP MATRIX DEFINITION for details.
Note:
DATAPLOT uses the LINPACK routine SGECO to compute the condition number.
Default:
None
Synonyms:
None
Related Commands:
 MATRIX INVERSE = Compute a matrix inverse. MATRIX DETERMINANT = Compute the determinant of a matrix. MATRIX SOLUTION = Solve a system of linear equations.
Reference:
Dongarra, Bunch, Moler, Stewart (1979), "LINPACK User's Guide," Siam.
Applications:
Linear Algebra
Implementation Date:
2011/9
Program:
```
DIMENSION 100 COLUMNS
16 16 19 21 20
14 17 15 22 18
24 23 21 24 20
18 17 16 15 20
18 11  9 18  7
END OF DATA
LET C  = MATRIX CONDITION NUMBER X
LET RC = MATRIX RECIPROCAL CONDITION NUMBER X
PRINT C RC
```
The following output is generated.
```C       --          31.82
RC      --           0.03
```

Date created: 09/14/2011
Last updated: 09/14/2011