<div dir="ltr">Dear Alberto,<div><br></div><div>Please check if EEGLAB option is set so that it does 'precompute' EEG.icaact. Nowadays there is no reason not to have EEG.icaact in my opinion.</div><div><br></div><div>Makoto</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 10, 2017 at 9:40 AM, Alberto Sainz <span dir="ltr"><<a href="mailto:albertosainzc@gmail.com" target="_blank">albertosainzc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks a lot Makoto!!<div><br></div><div>It gave me this error: Index exceeds matrix dimensions.</div><div><br></div><div>I found icaact was empty. I checked the forum and I tried EEG = eeg_checkset(EEG, 'ica'); but didnt work.</div><div><br></div><div>Then I tried EEG.icaact = (EEG.icaweights*EEG.icasphere)<wbr>*EEG.data(EEG.icachansind,:);</div><div><br></div><div>Now it works :)<br><br>I post it in case someone needs it in the future.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-12-30 1:14 GMT+01:00 Makoto Miyakoshi <span dir="ltr"><<a href="mailto:mmiyakoshi@ucsd.edu" target="_blank">mmiyakoshi@ucsd.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Alberto,<span><div><br></div><div>> How do I select component 1?</div><div><br></div></span><div>Use EEG.icaact(1,:,:) instead.</div><span><div><br></div><div>> Since I just reduced all the ICA components to 1 doing PCA, shouldnt I select component 1 (out of 1)?</div><div><br></div></span><div>Yes.</div><span><div><br></div><div>> If i select a channel then I am not taking all the data from the full EEG recording, right?<br></div><div class="gmail_extra"><br></div></span><div class="gmail_extra">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).</div><span class="m_-473482665506474370HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra">Makoto</div></font></span><div><div class="m_-473482665506474370h5"><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 19, 2016 at 10:49 AM, Alberto Sainz <span dir="ltr"><<a href="mailto:albertosainzc@gmail.com" target="_blank">albertosainzc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thank you very much Makoto!<br><br>I think i am going to use the PCA method in a small sample of recordings and lets see what happens.<br><br>I was doing it right now and I got stucked in your code:<br><br>[spectra,freqs] = spectopo(EEG.data(2,:,:), 0, EEG.srate);<br><div><br></div><div>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.<br><br>If i select a channel then I am not taking all the data from the full EEG recording, right?<br><br>Thank you!</div></div><div class="m_-473482665506474370m_-5229227750743915666gmail-HOEnZb"><div class="m_-473482665506474370m_-5229227750743915666gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-12-14 4:41 GMT+01:00 Makoto Miyakoshi <span dir="ltr"><<a href="mailto:mmiyakoshi@ucsd.edu" target="_blank">mmiyakoshi@ucsd.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Dear Alberto,<div><br></div><div>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.</div><div><br></div><div>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.</div><span><div><br></div><div>> how would you average the total frequency of all channels?<br></div><div><br></div></span><div>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?</div><div><br></div><div>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.</div><span class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133HOEnZb"><font color="#888888"><div><br></div><div>Makoto</div></font></span><div><div class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133h5"><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 12, 2016 at 5:53 PM, Alberto Sainz <span dir="ltr"><<a href="mailto:albertosainzc@gmail.com" target="_blank">albertosainzc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Dear Makoto,<div><br></div><div>I meant to use PCA before ICA. In the paper described (link: <a href="http://www.ijcaonline.org/archives/volume42/number15/5770-7993" target="_blank">http://www.ijcaonline.o<wbr>rg/archives/volume42/number15/<wbr>5770-7993</a> ) they use frist ICA and then PCA to reduce data to only one component. </div><div>My question is, how valid this could be? How much data do we lose doing this?<br><br>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).</div><div><br></div><div>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!!</div><div><br></div><div>Sorry I know there are too many questions! I hope you understand what I mean.<br><br>Thanks</div></div><div class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail-HOEnZb"><div class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-12-07 0:14 GMT+01:00 Makoto Miyakoshi <span dir="ltr"><<a href="mailto:mmiyakoshi@ucsd.edu" target="_blank">mmiyakoshi@ucsd.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Dear Alberto,<span><div><br></div><div>> can anyone explain why we would perform first an ICA and then a PCA?<br></div><div class="gmail_extra"><br></div></span><div class="gmail_extra">You can apply PCA as a preprocessing for ICA. We sometimes do it (you know, runica() has an option 'pca' to reduce dimensions.)</div><span><div class="gmail_extra"><br></div><div class="gmail_extra">> 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.</div><div class="gmail_extra"><br></div></span><div class="gmail_extra">See my new help wiki page for how to do it.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://sccn.ucsd.edu/wiki/Makoto%27s_useful_EEGLAB_code" target="_blank">https://sccn.ucsd.edu/wiki/Mak<wbr>oto%27s_useful_EEGLAB_code</a><br></div><span><div class="gmail_extra"><br></div><div class="gmail_extra">> I guess this accumulates a lot of error, could anyone tell me if this procedure would be valid?<br></div><div class="gmail_extra"><br></div></span><div class="gmail_extra">Not necessarily. It's not the errors that accumulates, but you drop information.</div><div class="gmail_extra">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.</div><div class="gmail_extra"><br></div><div class="gmail_extra">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. </div><span><div class="gmail_extra"><br></div><div class="gmail_extra">> could anyone tell me if this procedure would be valid?<br></div><div class="gmail_extra"><br></div></span><div class="gmail_extra">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! </div><div class="gmail_extra"><br></div><div class="gmail_extra">Makoto</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail-m_3757379842383845106h5">On Mon, Nov 28, 2016 at 6:57 AM, Alberto Sainz <span dir="ltr"><<a href="mailto:albertosainzc@gmail.com" target="_blank">albertosainzc@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail-m_3757379842383845106h5"><div dir="ltr">Hello,<div><br></div><div>I have a question regarding ICA and PCA.</div><div><br></div><div>Following the paper "Power Spectrum Analysis of EEG Signals for Estimating</div><div>Visual Attention" to calculate Power Spectrum by frequencies, they perform first an ICA and then a PCA.<br><br>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?<br><br>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?</div><div><br></div><div>thanks!</div></div>
<br></div></div>______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/ee<wbr>glabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.uc<wbr>sd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.e<wbr>du</a><span class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail-m_3757379842383845106HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail-m_3757379842383845106HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail-m_3757379842383845106m_7929993524042186761gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</font></span></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-473482665506474370m_-5229227750743915666gmail-m_-3992022071962058133m_975455870577342381gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-473482665506474370m_-5229227750743915666gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div>