inconsistent condition numbers from cond, det, inv functions
Rolf Fabian
Rolf.Fabian at gmx.de
Thu Feb 7 06:00:50 CST 2008
My personal condh.m function accepts a 2nd argument
p = 1, 2, 'fro', 'inf', Inf, ...
accounting for the different matrix norms provided by 'norm.m'
which is used in evaluation of condition number.
octave-3.0.0.exe:> 1./condh(x,1)
ans = 2.3130e-018
octave-3.0.0.exe:> 1./condh(x,2)
ans = 4.1351e-017
octave-3.0.0.exe:44> 1/condh(x,'fro')
ans = 3.8375e-018
octave-3.0.0.exe:> 1./condh(x,Inf)
ans = 2.3130e-018
octave-3.0.0.exe:> 1./condh(x,'inf')
ans = 2.3130e-018
We conclude that Octave's
[dum,rc] = det() and [dum,rc] = inv()
both return rc using either 1-norm or infinity norm,
whereas cond() defines rc via 2-norm.
Furthermore MatLabs result seems
to be unexplainable.
Unfortunately example matrix x was choosen to be symmetric.
This wasn't a good choice because Inf- and 1-norms are
idential in this case.
Using instead the asymmetric matrix
octave-3.0.0.exe:> y=[7,2,3;1,3,4;6,4,5]
y =
7 2 3
1 3 4
6 4 5
octave-3.0.0.exe:> 1/condh(y,1)
ans = 0.017460
octave-3.0.0.exe:> 1/condh(y,2)
ans = 0.019597
octave-3.0.0.exe:> 1/condh(y,'fro')
ans = 0.018714
octave-3.0.0.exe:> 1/condh(y,'inf')
ans = 0.012022
octave-3.0.0.exe:> 1/condh(y,Inf)
ans = 0.012022
octave-3.0.0.exe:37> [dum,rc1]=det(y)
rc1 = 0.017460
octave-3.0.0.exe:38> [dum,rc2]=inv(y)
rc2 = 0.017460
octave-3.0.0.exe:39> rc3 = 1/cond(y)
rc3 = 0.019597
allows to differentiate between 1- and Inf -norm.
Ben, what' s the result for 1./cond(y) ?
Does Matlabs cond() have a similar argument 'p' too?
Summary and Conclusion:
(1) Octave's det() and inv() return condition number rc defined via 1-norm,
(2) whereas cond() defines condition number via 2-norm.
(3) MatLabs result is not understandable in the framework of
different modes of norms. Maybe they mix norm-modes ?
( 'norm' is called 2 times by cond ). Obviously further studies
are required.
Suggestion
(1) and (2) should be aligned, preferentially using 1-norm, Inf-norm or
Fro-norm
but definitely not 2-norm, because this requires svd and may leads to
performance deficits for large mats.
Rolf Fabian
-----
Rolf Fabian
<r dot fabian at jacobs-university dot de>
--
View this message in context: http://www.nabble.com/inconsistent-condition-numbers-from-cond%2C-det%2C-inv-functions-tp15330097p15332414.html
Sent from the Octave - Bugs mailing list archive at Nabble.com.
More information about the Bug-octave
mailing list