Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cond

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

Examples

cond(hilb(8))

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.