?=================================================================== ? Condition number for a data matrix. = ? User must define the data matrix with the following line: = ? = ? NAMELIST ; X = ... $ = ?=================================================================== ? User must change the next line to define data matrix ? NAMELIST ; X = ...$ To define data matrix ? ? XX = X'X. We then divide X'X(i,j) by the square root of X'X(i,i)*X'X(j,j) to accomplish ? the normalization. Then, CRX = characteristic roots. The result would be visible at this ? point. CALC just sets up a display. Works for any data matrix. ? MATRIX ; XX = XDOT(X) ? X'X ; DX = DIAG(XX) ? Diagonals ; XX = ISQR(DX) | XX | ISQR(DX) ? Normalize ; CRX = ROOT(XX) $ ? Roots ? ? We report reciprocal to avoid possibly dividing by zero if short rank. ? CALC ; K = ROW(CRX) ; CN = SQR(CRX(1)) / SQR(CRX(K)) $