[Eeglablist] Adjust data rank for ICA?

Anna Bánki anna.banki at univie.ac.at
Sun Mar 12 11:56:51 PDT 2023


Dear All,


Thanks so much to all of you ffor your help! I decided to only choose my 24 scalp channels for the ICA, but I do not fully remove the gyroscope channels 25-25-27 from the data. In fact, I am not sure if I should or if it is enough to simply define the channels for ICA for the 1-24 scalp channels like I did below?

EEG = pop_runica(EEG,  'icatype', 'runica', 'maxsteps', 400, 'lrate', 0.0003, 'dataset',1, 'options',{ 'extended',1}, 'chanind', [1:24]);

As some of these 24 scalp channels are previously interpolated (e.g. usually 3), I changed the one line suggested in pop_runica from max to min:
%tmprank2 = max(tmprank, tmprank2);
tmprank2 = min(tmprank, tmprank2);

This is the message I am getting:
readlocs(): 'BESA' format assumed from file extension
BESA header detected, skipping three lines...
Readlocs: BESA spherical coords. converted, now deleting BESA fields
          to avoid confusion (these fields can be exported, though)
Channel lookup: no location for GyroX,GyroY,GyroZ
Send us standard location for your channels at eeglab at sccn.ucsd.edu
Attempting to convert data matrix to double precision for more accurate ICA results.
Data rank (21) is smaller than the number of channels (24).
Input data size [21,194000] = 21 channels, 194000 frames/n After PCA dimension reduction,
  finding 21 ICA components using extended ICA.
Kurtosis will be calculated initially every 1 blocks using 6000 data points.
Decomposing 439 frames per ICA weight ((441)^2 = 194000 weights, Initial learning rate will be 0.0003, block size 61.
Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg.
More than 32 channels: default stopping weight change 1E-7
Training will end when wchange < 1e-06 or after 400 steps.
Online bias adjustment will be used.
Removing mean of each channel ...
Final training data range: -278.56 to 421.442
Reducing the data to 21 principal dimensions...

So it seems I am getting the 21 data rank now because I previously interpolated 3 scalp channels and it looks fine to me. Do you think based on your experience I am on the right track with this approach or would you recommend any other changes to counteract the rank-deficiency issue?

Thanks a lot!

All the best,
Anna



________________________________
From: Cedric Cannard <ccannard at protonmail.com>
Sent: 27 February 2023 23:28:19
To: Anna Bánki
Cc: Daniele Scanzi; Julia Basso; eeglablist at sccn.ucsd.edu
Subject: Re: [Eeglablist] Adjust data rank for ICA?

Hi Anna,

Not sure what this code does.

Yes, to take into account data rank deficiency when running ICA, do this:

dataRank = sum(eig(cov(double(EEG.data'))) > 1E-7);  % get accurate data rank
EEG = pop_runica(EEG,'icatype','runica','extended',1,'pca',datarank);

Remove the GYRO channels before ICA and do not try to interpolate them. You can add them back later if you need them.

Make sure you don't interpolate channels before ASR.

Note that EEGLAB's official guideline is to interpolate channels later at the STUDY level.

Cedric



------- Original Message -------
On Friday, February 17th, 2023 at 11:14 AM, Anna Bánki <anna.banki at univie.ac.at> wrote:


> Hi Daniele, Julia,
>
>
> I am also interpolating some bad channels (max 3-4) before running ICA. Could you help, apart from changing max to min in the pop_runica[] script, would you also set back the full rank before running ICA with this code?
>
>
> channelSubset = loc_subsets(EEG.chanlocs, yourDataRankHere);
> EEG = pop_select( EEG,'channel', channelSubset{1});
> EEG = pop_chanedit(EEG, 'eval','chans = pop_chancenter( chans, [],[]);');
>
>
> https://sccn.ucsd.edu/wiki/Makoto's_preprocessing_pipeline#Interpolate_all_the_removed_channels_.2803.2F05.2F2021_updated.29
>
> In my layout, there are 3 gyroscope channels on top of the 24 scalp channels, so for now, I only selected my channels as 1:24 before ICA, but did not consider the rank-deficiency issue.
>
>
> Thanks,
>
> Anna
>
> ________________________________
> From: eeglablist eeglablist-bounces at sccn.ucsd.edu on behalf of Daniele Scanzi dsca347 at aucklanduni.ac.nz
>
> Sent: 16 February 2023 21:47
> To: Julia Basso
> Cc: eeglablist at sccn.ucsd.edu
> Subject: Re: [Eeglablist] Adjust data rank for ICA?
>
> Hi Julia,
>
> From my understanding, you should still change that line (I think it is
> line 624) from max to min, otherwise 'runica' most likely won't adjust for
> rank-deficient data.
>
> Cheers,
>
> Daniele
>
> On Fri, 17 Feb 2023 at 09:34, Julia Basso jbasso at vt.edu wrote:
>
> > Hi,
> >
> > We are reading Makato's preprocessing pipeline and utilizing the general
> > pipeline for our dataset. We have interpolated across some bad channels and
> > have taken note of the section on "Adjust data rank for ICA". We see that
> > he recommends changing one line of code in pop_runica() from max to min, to
> > adjust for the number of interpolated channels. However, this was a note
> > from 5/17/19. Has anything been adjusted in the current code to adjust for
> > this problem?
> >
> > Do you recommend doing this or should we leave it at max?
> >
> > Thank you for any help you can provide!
> >
> > Best,
> >
> > Dr. Basso
> >
> > --
> > _______________________________________________
> > 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
> _______________________________________________
> 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