Mon 09 Mar 2015 03:35:30 PM UTC, comment #4:
Max, to answer your question about copyright, since you've apparently read Matlab's source code, we cannot accept any code from you for this problem.
However, your suggestion to use an economy svd decomposition and/or implement Matlab's "0" argument for svd can be a good place to start.
|
Mon 09 Mar 2015 02:57:43 PM UTC, comment #3:
From a previous IRC discussion, the problem is actually on svd being very very slow
|
Mon 09 Mar 2015 07:12:06 AM UTC, original submission:
I'm developing some code under Matlab and Octave. However, princomp in Octave miserably.
My minimum working example is:
'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
|