octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57185] svds returns inconsistent singular val


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #57185] svds returns inconsistent singular values
Date: Fri, 8 Nov 2019 07:10:33 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36

Update of bug #57185 (project octave):

                Severity:              3 - Normal => 4 - Important          
                  Status:            Works For Me => Confirmed              
                 Summary: svd returns inconsistent eigenvalues => svds returns
inconsistent singular values

    _______________________________________________________

Follow-up Comment #6:

Now this makes sense, same for default hg_id 959a63d1ede6:


x = randn(10, 5) ;
y = randn(10, 5) ;
z = complex(x, y) ;

[~, Dr] = svds(x);
svds_x = [diag(Dr), svds(x), svd(x)]
[~, Dc] = svds(z);
svd_z = [diag(Dc), svds(z), svd(z)]

isreal(Dr)
arrayfun (@isreal, svd_z)


The output


svds_x =

   5.1420   5.1420   5.1420
   3.0993   3.0993   3.0993
   2.7733   2.7733   2.7733
   2.1100   2.1100   2.1100
   1.4318   1.4318   1.4318

svd_z =

   2.6499 + 0.0000i   7.3784 - 0.0000i   7.3784 + 0.0000i
   3.8673 + 0.0000i   5.7718 - 0.0000i   5.7718 + 0.0000i
   4.3697 - 0.0000i   4.3697 - 0.0000i   4.3697 + 0.0000i
   5.7718 - 0.0000i   3.8673 + 0.0000i   3.8673 + 0.0000i
   7.3784 + 0.0000i   2.6499 - 0.0000i   2.6499 + 0.0000i

ans = 1
ans =

  0  0  1
  0  0  1
  0  0  1
  0  0  1
  0  0  1


Thus two problems:

1. The order of the singular values depends on the number of output arguments

2. The singular values are complex values.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57185>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]