cond: Matrix Condition

View source: R/cond.R

condR Documentation

Matrix Condition

Description

Condition number of a matrix.

Usage

cond(M, p = 2)

Arguments

M

Numeric matrix; vectors will be considered as column vectors.

p

Indicates the p-norm. At the moment, norms other than p=2 are not implemented.

Details

The condition number of a matrix measures the sensitivity of the solution of a system of linear equations to small errors in the data. Values of cond(M) and cond(M, p) near 1 are indications of a well-conditioned matrix.

Value

cond(M) returns the 2-norm condition number, the ratio of the largest singular value of M to the smallest.

c = cond(M, p) returns the matrix condition number in p-norm:

norm(X,p) * norm(inv(X),p).

(Not yet implemented.)

Note

Not feasible for large or sparse matrices as svd(M) needs to be computed. The Matlab/Octave function condest for condition estimation has not been implemented.

References

Trefethen, L. N., and D. Bau III. (1997). Numerical Linear Algebra. SIAM, Philadelphia.

See Also

normest, svd

Examples

cond(hilb(8))

pracma documentation built on Nov. 10, 2023, 1:14 a.m.