[Eeglablist] EEG data rank

Cedric Cannard ccannard at protonmail.com
Fri Mar 5 11:44:18 PST 2021


Hi Makoto,

Thank you and sorry as this topic has probably been discussed so many times in the past.

I found yesterday that same code by Sven Hoffman at the end of pop_runica and other eeglablist threads:
    covarianceMatrix = cov(EEG.data', 1);
    [~, D] = eig(covarianceMatrix);
    rankTolerance = 1e-7;
    data_rank = sum(diag(D) > rankTolerance);
However, it was missing the double-precision, which was also giving me the wrong data rank. And it's nice to have it in 1 line now, thanks.

I am now able to avoid the corrupted decompositions I was getting because of the rank deficiency by adding the 'pca' -(EEG.nbchan-dataRank)) when running ICA. I was getting this message even though I am not on Linux:
    Warning: fixing rank computation inconsistency (64 vs 60) most likely because running under Linux 64-bit Matlab
Do I get this error because I don't have enough memory when trying to convert to double precision as for binica option (line 401)? This seems unlikely though.
And it looks like it is taking the highest rank 64 detected by the getrank function instead of the rank 60, which led to corrupted decompositions (pop_runica line 595). But I am now seeing on your preprocessing pipeline page that you use the min instead of max, which makes more sense to me.

Considering the implications for both ICA and ASR, did I miss a pull or is this just not validated yet? Why isn't rank-deficiency detection the default?

Also, why is running ICA after channel interpolation and average-referencing always recommended in the wiki if that poses rank-deficiency problems?
Why not removing bad channels and trials, run ICA and remove bad ICs, re-reference, and then interpolate bad channels from this cleaned data?
I saw on your page that the average ref makes all the ICA scalp topography have zero total potential and helps to remove line noise. While the line noise argument is not an advantage in my case as I low-pass below it, what is the advantage regarding the potentials? does it create 2 corrupted components (1 for each charge) instead of 1? Doesn't ICA remove both polarities of the same component anyway?

Thanks in advance,

Cedric


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, March 5, 2021 9:50 AM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:

> Dear Cetric,
>
> See this article for your info.
> https://sccn.ucsd.edu/wiki/Makoto's_useful_EEGLAB_code#How_to_avoid_the_effect_of_rank-deficiency_in_applying_ICA_.2803.2F02.2F2021_added.29
>
> Makoto
>
> On Thu, Mar 4, 2021 at 2:47 PM Cedric Cannard ccannard at protonmail.com
> wrote:
>
> > Hi,
> > Never mind, it works with rank(double(EEG.data))
> > Sorry, I thought EEGLAB' data had double precision by default.
> > Cedric
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> > On Wednesday, March 3, 2021 6:27 PM, Cedric Cannard <
> > ccannard at protonmail.com> wrote:
> >
> > > Hi everyone,
> > > I was trying to assess data rank after importing some Biosemi and
> > > Neuroscan data, trying different importing methods, as well as
> > > re-referencing methods (average and REST) to see their impacts on rank, but
> > > get weird numbers (e.g. rank 1, 9, 21 with 64 channels data). I have been
> > > using rank(EEG.data) in Matlab 2020b.
> > > I have tried importing data with pop_biosig and pop_readbdf, with Cz as
> > > reference or no reference (same results), and pop_loadcnt for neuroscan
> > > .cnt data.
> > > I am also seeing rank changes after downsampling, filtering,
> > > interpolating channels, etc.
> > > Is this not the right way to assess rank?
> > > Cedric
> >
> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> > To unsubscribe, send an empty email to
> > eeglablist-unsubscribe at sccn.ucsd.edu
> > For digest mode, send an email with the subject "set digest mime" to
> > eeglablist-request at sccn.ucsd.edu
>
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu





More information about the eeglablist mailing list