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

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

[Octave-bug-tracker] [bug #44491] Octave's princomp is inferior to Matla


From: Max Görner
Subject: [Octave-bug-tracker] [bug #44491] Octave's princomp is inferior to Matlab's
Date: Mon, 09 Mar 2015 07:12:08 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.5.0

URL:
  <http://savannah.gnu.org/bugs/?44491>

                 Summary: Octave's princomp is inferior to Matlab's
                 Project: GNU Octave
            Submitted by: maxg
            Submitted on: Mo 09 Mär 2015 07:12:06 GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Performance
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

I'm developing some code under Matlab and Octave. However, princomp in Octave
miserably.

My minimum working example is:

d = 0.01;
x = [-100:d:100]';
X = [x,x];
princomp(X);
error: out of memory or dimension too large for Octave's index type
error: called from:
error:   /usr/share/octave/packages/statistics-1.2.3/princomp.m at line 70,
column 18


'X' is not even 1MiB in size, but I get this error. Matlab performs this
code.

Furthermore, Matlab is way faster. If we change 'd' to 'd = 0.05' and perform
the same code again, Octave takes 0.2 seconds and Matlab 0.001 seconds. On
other matrices the ratio of ~100 reproduces.

I think I traced that down to the fact that Matlab ...
a) uses a special case with [coeff,~] = eig(X'*X)
b) calls 'svd(X,0)' whereas Octave calls 'svd(X)'.

If I enter the '0' in Octave's princomp function, it works. It is still a lot
slower though.

Are there any reasons that the '0' is omittet? Are there any reasons that the
special case using the eig function is not used? I'd create a patch if these
questions are answered. Especially I'd like to know whether doing that call to
eig would violate any copyrights.

sincerely,
Max Görner




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44491>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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