[Eeglablist] PSD: ICA+PCA?

Alberto Sainz albertosainzc at gmail.com
Tue Jan 10 09:40:29 PST 2017


Thanks a lot Makoto!!

It gave me this error: Index exceeds matrix dimensions.

I found icaact was empty. I checked the forum and I tried EEG =
eeg_checkset(EEG, 'ica'); but didnt work.

Then I tried EEG.icaact =
(EEG.icaweights*EEG.icasphere)*EEG.data(EEG.icachansind,:);

Now it works :)

I post it in case someone needs it in the future.

2016-12-30 1:14 GMT+01:00 Makoto Miyakoshi <mmiyakoshi at ucsd.edu>:

> Dear Alberto,
>
> > How do I select component 1?
>
> Use EEG.icaact(1,:,:) instead.
>
> > Since I just reduced all the ICA components to 1 doing PCA, shouldnt I
> select component 1 (out of 1)?
>
> Yes.
>
> > If i select a channel then I am not taking all the data from the full
> EEG recording, right?
>
> Right. If you use IC(s), then these ICs contributes to multiple channels
> so you can claim that you are using full part of data (channels).
>
> Makoto
>
>
>
> On Mon, Dec 19, 2016 at 10:49 AM, Alberto Sainz <albertosainzc at gmail.com>
> wrote:
>
>> Thank you very much Makoto!
>>
>> I think i am going to use the PCA method in a small sample of recordings
>> and lets see what happens.
>>
>> I was doing it right now and I got stucked in your code:
>>
>> [spectra,freqs] = spectopo(EEG.data(2,:,:), 0, EEG.srate);
>>
>> This selects channel 2 of the data. How do I select component 1? Since I
>> just reduced all the ICA components to 1 doing PCA, shouldnt I select
>> component 1 (out of 1)? I checked the spectopo help and I only see I can
>> select channels, not components.
>>
>> If i select a channel then I am not taking all the data from the full EEG
>> recording, right?
>>
>> Thank you!
>>
>> 2016-12-14 4:41 GMT+01:00 Makoto Miyakoshi <mmiyakoshi at ucsd.edu>:
>>
>>> Dear Alberto,
>>>
>>> PCA before ICA has a meaning of dimension reduction to allow ICA to have
>>> less model order (this is empirical though). Since you can project
>>> dimension-reduced PCs to channels any time, the meaning of the process is
>>> pretty straightforward.
>>>
>>> PCA after ICA is a bit tricky. I guess you can do that as long as your
>>> PCA (1st or up to 3rd or whatever) results show that good portion of the
>>> data variance is accounted for by those... in my personal experience, the
>>> first PC could explain 50-60% of time-frequency results across all ICs,
>>> which I thought is not too bad if I can say something interesting based
>>> upon it.
>>>
>>> > how would you average the total frequency of all channels?
>>>
>>> You can use ICA for the purpose of dimension reduction too; you count
>>> ICs until the 60% of the variance is accounted for, for example. Then what
>>> ICs does it select? That's a good question, isn't it?
>>>
>>> Relatedly, there is std_envtopo() plugin. It tells you which IC cluster
>>> explain how much of variance in grand averaged ERP envelope. This can tell
>>> you which cluster you should focus on, because it tells you who is most
>>> dominant in which ERP (envelope) component.
>>>
>>> Makoto
>>>
>>>
>>>
>>> On Mon, Dec 12, 2016 at 5:53 PM, Alberto Sainz <albertosainzc at gmail.com>
>>> wrote:
>>>
>>>> Dear Makoto,
>>>>
>>>> I meant to use PCA before ICA. In the paper described (link:
>>>> http://www.ijcaonline.org/archives/volume42/number15/5770-7993 ) they
>>>> use frist ICA and then PCA to reduce data to only one component.
>>>> My question is, how valid this could be? How much data do we lose doing
>>>> this?
>>>>
>>>> Thanks for the code, I already took it before from the list :). My idea
>>>> was actually applying the code to the only component left after ICA+PCA.
>>>> Otherwise I would have to apply the code for each channel/component (that
>>>> was my previous idea).
>>>>
>>>> In case doing PCA after ICA is not a good option, how would you average
>>>> the total frequency of all channels? By a simple avergaing code? Or maybe
>>>> im missing something and there is no point on averaging the power of all
>>>> channels/components!!
>>>>
>>>> Sorry I know there are too many questions! I hope you understand what I
>>>> mean.
>>>>
>>>> Thanks
>>>>
>>>> 2016-12-07 0:14 GMT+01:00 Makoto Miyakoshi <mmiyakoshi at ucsd.edu>:
>>>>
>>>>> Dear Alberto,
>>>>>
>>>>> > can anyone explain why we would perform first an ICA and then a PCA?
>>>>>
>>>>> You can apply PCA as a preprocessing for ICA. We sometimes do it (you
>>>>> know, runica() has an option 'pca' to reduce dimensions.)
>>>>>
>>>>> > Also, before reading this paper, my intention was to perform an ICA,
>>>>> average the power for each component in a specific frecuency band and then
>>>>> average those means for the same frequency.
>>>>>
>>>>> See my new help wiki page for how to do it.
>>>>>
>>>>> https://sccn.ucsd.edu/wiki/Makoto%27s_useful_EEGLAB_code
>>>>>
>>>>> > I guess this accumulates a lot of error, could anyone tell me if
>>>>> this procedure would be valid?
>>>>>
>>>>> Not necessarily. It's not the errors that accumulates, but you drop
>>>>> information.
>>>>> Dimension reduction by PCA or ICA (ICA results are also sorted by
>>>>> variance, so the near-last ICs are very small; removing them would not make
>>>>> visible differences but still reduces data ranks) means that you use less
>>>>> than 100% of data variance.
>>>>>
>>>>> Imagine you have 128 channel and only analyze Fz, Cz, and Pz. This is
>>>>> much more wasteful. Reasonable dimension reduction is indispensable for any
>>>>> high-dimensional data processing.
>>>>>
>>>>> > could anyone tell me if this procedure would be valid?
>>>>>
>>>>> It's a trade off between surveyability and amount of data--if you
>>>>> focus on less Independent/Principal components, you get more surveyability
>>>>> but loosing more information. If you use more ICs/PCs, data are hard to
>>>>> survey. You can't put all the info you have on a paper anyway, so selection
>>>>> is always necessary. You need courage to focus on data, I know!
>>>>>
>>>>> Makoto
>>>>>
>>>>>
>>>>> On Mon, Nov 28, 2016 at 6:57 AM, Alberto Sainz <
>>>>> albertosainzc at gmail.com> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I have a question regarding ICA and PCA.
>>>>>>
>>>>>> Following the paper "Power Spectrum Analysis of EEG Signals for
>>>>>> Estimating
>>>>>> Visual Attention" to calculate Power Spectrum by frequencies, they
>>>>>> perform first an ICA and then a PCA.
>>>>>>
>>>>>> I understand that PCA concentrates the information in less components
>>>>>> (in this case in just one) so its easier to work with the data (in this
>>>>>> case to measure power by frequency bands). However, I think I miss
>>>>>> something about the ICA. My understanding is that ICA separates the signals
>>>>>> to make them independent. If this is the case, can anyone explain why we
>>>>>> would perform first an ICA and then a PCA? Which would be the sense of
>>>>>> separating the signals to concentrate them together again?
>>>>>>
>>>>>> Also, before reading this paper, my intention was to perform an ICA,
>>>>>> average the power for each component in a specific frecuency band and then
>>>>>> average those means for the same frequency. I guess this accumulates a lot
>>>>>> of error, could anyone tell me if this procedure would be valid?
>>>>>>
>>>>>> thanks!
>>>>>>
>>>>>> _______________________________________________
>>>>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>>>>> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.uc
>>>>>> sd.edu
>>>>>> For digest mode, send an email with the subject "set digest mime" to
>>>>>> eeglablist-request at sccn.ucsd.edu
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Makoto Miyakoshi
>>>>> Swartz Center for Computational Neuroscience
>>>>> Institute for Neural Computation, University of California San Diego
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Makoto Miyakoshi
>>> Swartz Center for Computational Neuroscience
>>> Institute for Neural Computation, University of California San Diego
>>>
>>
>>
>
>
> --
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20170110/a7287080/attachment.html>


More information about the eeglablist mailing list