[Eeglablist] ICA "adds" noise?
Arnaud Delorme
arno at ucsd.edu
Fri Jan 25 11:18:36 PST 2013
Dear Matt and others,
Note that sometimes there are problems using the rank function.
Because of numerical imprecision, it does not return the actual rank of the matrix.
Before running ICA in pop_runica we compute the rank (on the double precision data)
tmprank = rank(tmpdata);
and then we double check with another function contributed by Sven Hoffman
covarianceMatrix = cov(tmpdata', 1);
[E, D] = eig (covarianceMatrix);
rankTolerance = 1e-7;
tmprank2=sum (diag (D) > rankTolerance);
We check if there are the same, and if they are not, we are taking the value which is highest between the two.
Best,
Arno
On 24 Jan 2013, at 09:49, Matt Craddock wrote:
> Hi all,
>
> Since I'm using a BioSemi system, there is no reference electrode to
> begin with (save an implicit one approximately between the locations of
> CMS and DRL, I guess), and the data must always be re-referenced. There
> is no blank channel to include when calculating the average reference -
> or something to reconstruct with any other reference - so I guess by
> default you're dropping the implicit reference channel. Anyway, here's
> me going through a few steps with some of our data, with 64 scalp
> channels, 4 EOG channels, and 2 earlobe channels:
>
> on import without any reference at all:
> rank(double(EEG.data)) = 70
>
> re-reference to average:
> rank(double(EEG.data)) = 70
>
> re-reference from average or from no reference to the average of the
> earlobes:
> rank(double(EEG.data)) = 68
>
> re-reference to average from the earlobes, without reconstructing
> reference channel:
> rank(double(EEG.data)) = 68
>
> re-reference to average from the earlobes, reconstructing reference channel:
> rank(double(EEG.data)) = 69
> (reduced from 70 because the earlobes are now the same)
>
> So, with BioSemi, re-referencing straight to the average reference
> doesn't seem to reduce rank, and there's no way to keep a reference
> channel by default; however, the last value of the svd of the avg
> referenced data is 0...
>
> I'd also note that the above ranks are calculated with matlab's rank
> function; if you use the alternative method included in pop_runica, the
> ranks it reports for the above data are 70, 69, 67, 67, and 68
> respectively, which are more in keeping with my naive expectations of
> how re-referencing would affect rank - numChans-1 (or 2). This is the
> source of the error message I mentioned in an earlier email, where
> EEGlab overrules the latter method and uses only the matlab rank
> command's estimates.
>
> But to get back to what started it all, I guess Kristina's problem was
> solved already by Joe and Makoto - if you've referenced to multiple
> channels, and leave both in the data, you need to take one out or you
> may get the kind of duplicate components she saw, whereas my case was a
> little different, perhaps caused by undetected bridged electrodes. So
> it's not caused by any rank reduction introduced by (re-)referencing
> *per se* but by keeping multiple dependent channels in the data (of
> which a symptom would be reduced rank?), and the best thing is probably
> just to remove one of those channels. Is that a reasonable summary?
>
> Anyway, thanks a lot for the discussion, been illuminating even if I've
> ended up overcomplicating it!
>
> Cheers,
> Matt
>
> On 24/01/2013 02:45, Jason Palmer wrote:
>> Hi Joseph et al.,
>>
>> I believe that any reference, average or channel, does reduce the rank
>> by one. This is straightforward to show using linear algebra, e.g., here:
>>
>> http://sccn.ucsd.edu/wiki/Linear_Representations_and_Basis_Vectors#EEG_Data_Reference_and_Re-referencing
>>
>> The rank that matlab gives you depends on the tolerance used to declare
>> small dimensions zero. E.g. a rank deficient matrix usually has smallest
>> eigenvalue of around 1e-15 to 1e-8, due to numerical imprecision,
>> particularly with large ill-conditioned matrices. You should see a
>> sudden “drop off” though in the eigenvalue magnitudes after the
>> theoretical rank.
>>
>> Best,
>>
>> Jason
>>
>> *From:*eeglablist-bounces at sccn.ucsd.edu
>> [mailto:eeglablist-bounces at sccn.ucsd.edu] *On Behalf Of *Joseph Dien
>> *Sent:* Wednesday, January 23, 2013 11:54 AM
>> *To:* Matt Craddock
>> *Cc:* eeglablist at sccn.ucsd.edu; Kristina Borgström
>> *Subject:* Re: [Eeglablist] ICA "adds" noise?
>>
>> Hmmm…. I should know better than to talk off the top of my head like that…
>>
>> Well, part right, part wrong.
>>
>> It's easy enough to just try it out and see what Matlab says the rank is
>> of the data. I took some Cz-referenced 129-channel data and then
>> rereferenced it to mean mastoid and to average reference.
>>
>>>> rank(undata)
>>
>> ans =
>>
>> 128
>>
>>>> rank(mmdata)
>>
>> ans =
>>
>> 128
>>
>>>> rank(ardata)
>>
>> ans =
>>
>> 128
>>
>> so the bottom line is that average reference doesn't reduce the rank but
>> neither does mean mastoid (my error).
>>
>> As for the wiki page you linked to, it's worded in a confusing way.
>> It's not that "the average reference reduces the rank of the data"
>> necessarily. What it should say is that it doesn't increase the rank of
>> the data. So if you start off with 128 recording channels and a
>> reference channel (n=129) and rank is 128 (because voltage data is
>> relative by definition so two channels only give you one waveform), then
>> after average reference, the rank is still 128 even though it now looks
>> as though you've got 129 channels with independent waveforms. If you
>> dropped the 129th reference channel and then computed an average
>> reference channel, you would indeed lose another rank (as seen below)
>> but that would be because you were doing the procedure incorrectly and
>> had deleted a channel of meaningful information (even though it is
>> flat). The flat reference channel should always be included in the
>> average reference computation. The same goes for computing the mean
>> mastoid reference (or any other rereference), although unfortunately a
>> lot of systems throw that information away.
>>
>>>> rank(ar128data)
>>
>> ans =
>>
>> 127
>>
>> I definitely need to look into the effects of bridging more closely,
>> especially for frequency-based applications. This has been a very
>> helpful discussion!
>>
>> Joe
>>
>
>
> --
> Dr. Matt Craddock
>
> Post-doctoral researcher,
> Institute of Psychology,
> University of Leipzig,
> Seeburgstr. 14-20,
> 04103 Leipzig, Germany
> Phone: +49 341 973 95 44
> _______________________________________________
> 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