The Mathematica documentation says it is possible to estimate the matrix condition number in norms 1, 2, and ∞. But the 2-norm raises a message.
This is an extract from reference documentation "tutorial/LinearAlgebraMatrixComputations" where I changed the expression to compute the 2-Norm.

UPDATE
As requested, if you want to try by yourself and check the error on your system, simply type:
mat = {{1., 2.}, {3., 4.}};
LinearAlgebra`MatrixConditionNumber[mat, Norm -> 2]
Answer
The compatibility information at Compatibility/tutorial/LinearAlgebra/MatrixManipulation says
These functions were available in previous versions of Mathematica and are now available on the web at library.wolfram.com/infocenter/MathSource/6770:
LinearEquationsToMatrices
InverseMatrixNorm
ConditionNumber
You can download the original package there. It's too long to provide an excerpt here, but you can load it and use it in your code as-is.
(There seems to be a vestigial version of LinearAlgebra`MatrixConditionNumber which, as you noticed, only supports norms 1 and ∞.)
On the other hand, if you are okay with the computation involved in producing an exact answer, the documentation for SingularValueList says
The 2-norm of a matrix is equal to the largest singular value … The 2-norm of the inverse is equal to the reciprocal of the smallest singular value … [Thus,] The condition number of the matrix is equal to the ratio of largest to smallest singular values.
So you can use:
First@#/Last@#& @ SingularValueList[mat]
The old implementation for 2-norms is considerably faster for large random matrices (it is worth noting that both implementations seem to take advantage of multiple cores):

While the relative error stays low (this may depend on the precision of your input):

Comments
Post a Comment