bugGNU Octave - Bugs: bug #49309, matlab mismatch with [~,~,c]=svd(...

 
 

bug #49309: matlab mismatch with [~,~,c]=svd( [1,1,1] ,0)

Submitted by:  None
Submitted on:  Tue 11 Oct 2016 04:45:16 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: WTF, Matlab?!?
Status: FixedAssigned to: None
Originator Name: martinOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.0
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 11 Oct 2016 09:24:57 PM UTC, comment #5:

I checked in a compatibility fix on the development branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/68e9bdb7cde3).

Rik <rik5>
Project Administrator
Tue 11 Oct 2016 06:04:11 PM UTC, comment #4:

The difference probably isn't very useful, but probably is historic. I think they used to recommend '0' as the second argument whenever you didn't want the regular svd. At some point, they realized that their code wasn't actually calculating 'econ', but everyone was using '0' for a particular behavior. So, they left the old behavior under '0' and added a true 'econ' option.

I guess it isn't that hard to implement since it is only checking the input matrices rows and columns to decide what to do.

Rik <rik5>
Project Administrator
Tue 11 Oct 2016 05:00:39 PM UTC, comment #3:

I think the real issue is that for svd (X, 0) is not identical to svd (X, 'econ').

Am I missing something? Why is this difference useful?

John W. Eaton <jwe>
Project Administrator
Tue 11 Oct 2016 04:59:17 PM UTC, comment #2:

According to https://www.mathworks.com/help/matlab/ref/svd.html

So that seems to confirm this report.

Mike Miller <mtmiller>
Project Administrator
Tue 11 Oct 2016 04:55:03 PM UTC, comment #1:

When you supply a second argument the svd function is supposed to calculate the "economy" size version of the svd which eliminates unnecessary rows. Could you try the following code in Matlab and post what it returns?

Rik <rik5>
Project Administrator
Tue 11 Oct 2016 04:45:16 PM UTC, original submission:

there is a mismatch between matlab and octave behavior when using 0 as the second argument for svd

in octave 4.0.0

>> [~,~,c]=svd( [1,1,1] ,0)

c =

0.57735
0.57735
0.57735

in matlab 2014

K>> [~,~,c]=svd( [1,1,1] ,0)

c =

-0.5774 -0.5774 -0.5774
-0.5774 0.7887 -0.2113
-0.5774 -0.2113 0.7887

it would be good to modify the svd function to behave like matlab or raise an error

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 11 Oct 2016 09:24:57 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Tue 11 Oct 2016 05:00:50 PM UTCjweOpen/ClosedClosed=>Open
    Tue 11 Oct 2016 05:00:39 PM UTCjweItem GroupMatlab Compatibility=>WTF, Matlab?!?
      StatusNeed Info=>Confirmed
      Open/ClosedOpen=>Closed
    Tue 11 Oct 2016 04:55:03 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1