[Eeglablist] pop_runica rank calculation question

Matthew Stief ms2272 at cornell.edu
Fri Feb 17 17:30:21 PST 2012


Greetings!

I have a question regarding the way that pop_runica calculates rank.  It
does not seem to be doing so correctly for us.

I have been experimenting, and when I try to run it on relatively
unprocessed data, it seems to work properly, throws up no warning messages,
and tries to calculate components equal to the number of electrodes.
However, if I reduce the rank of the data by referencing to the average
electrode, it throws up this error:

Warning: fixing rank computation inconsistency (132 vs 131) most likely
because running under Linux 64-bit Matlab...
Finding 132 ICA components using extended ICA.

Now I have seen this error discussed on the list, but in this case I am
sure that it is wrong.  I know what I did to the dataset (i.e. changed to
the average reference), and I know that the correct rank should be 131.
I'm also not running in Linux, I'm running in Windows 7 with 64-bit Matlab
R2011b 7.13.0.564.

Now I've familiarized myself with the bug reported by Sven Hoffman on the
issues with the rank function and double versus single precision, and
switched to double precision in the memory options, and I notice that in
pop_runica the correct rank of 131 is being calculated by the code he
borrowed from fastica.

*   covarianceMatrix = cov(tmpdata', 1);
   [E, D] = eig (covarianceMatrix);
   rankTolerance = 1e-7;
   tmprank2=sum (diag (D) > rankTolerance);

*And that this is then compared with the output of the regular rank
function and whichever is largest is chosen, with a reference to the Linux
issue.  However, of course in this case the correct rank is actually the
smaller of the two!

Of course it would be simple to just change the code to instead select the
smaller of the two numbers, but before changing pop_runica I would love to
get the advice of the experts.

There is an additional issue as well, which is that if I reduce the rank by
changing to average reference, and then reduce the rank again by removing
artefactual components, Hoffman's code seems to lose track of the rank
reduction from the average reference and returns a rank as if only the
components have been removed!  This double-ICA approach isn't really the
one that I'm going to take with my data, but I'd still like to understand
how and why incorrect ranks are being calculated.

I'm guessing that the general solution to this issue will be to just keep
manual track of how much rank has been lost on theoretical grounds, but it
would certainly be nice if there were an automatic rank detection method
that worked.

-- 
_________________________________________________________________
Matthew Stief
Human Development | Sex & Gender Lab | Cornell University
http://www.human.cornell.edu/HD/sexgender


Heterosexuality isn't normal, it's just common.
-Dorothy Parker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20120217/4c95a35a/attachment.html>


More information about the eeglablist mailing list