Keith - <br><br>>> [wts,sph] = runica(somedata,'pca',64)  <br><br>does run first PCA, selects the largest 64 PC subspace, runs ICA (as its commandline output should attest), and will return the appropriate matrices. I do not have experience decomposing a CNV, and in fact routinely highpass the data about 1 Hz to better resolve the 3-250 Hz activities. PCA would accumulate much of the CNV in early components simply because it is numerically large. If ICA separates the CNV into several component processes, this might indeed reflect changes in the scalp distribution of the CNV during its time course.<br>
<br>Scott Makeig<br><br><div class="gmail_quote">On Wed, Jun 9, 2010 at 1:10 PM, Keith Yoder <span dir="ltr"><<a href="mailto:kjyoder@gmail.com">kjyoder@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>I have a related question:</div><div><br></div><div>We are recording using 128-channel BioSemi cap, plus four ocular leads and two mastoid leads.  All of the data are referenced to the right mastoid (leaving EEG.data with 133 rows).  We would like to use ICA, but have found that 133 components is too many (e.g. a CNV which is clear in the electrodes does not fall out as a component, but can be isolated with PCA using 5 components).  </div>

<div><br></div><div>Have other users had success using PCA to pre-process the data before passing them to ICA, so as to reduce the number of components identified by the ICA algorithm?  </div><div><br></div><div>A possible solution that I have been trying to implement would use PCA to identify a more reasonable number of components (e.g. 64) to then pass to ICA (all using runica):</div>

<div><br></div><div>% after using runica with " ,'pca',64 " to define 64 PCAs</div><div>% manually prepare component activations for ICA as if they were</div><div>% data from EEG.data (as laid out in pop_runica)</div>

<div>>> tmpdata = reshape(EEG.icaact(:,:,:),64,EEG.pnts*EEG.trials);</div><div>>> tmpdata = tmpdata - repmat(mean(tmpdata,2), [1 size(tmpdata,2)]);</div><div>>> [EEG.icaweights, EEG.icasphere] = runica(tmpdata, 'lrate', 0.001, 'interupt','on');</div>

<div><br></div><div>However, this call to runica returns the component weights and sphering for the ICA decomposition of the PCA-defined components, rather than ICA-defined weights and sphering for 64 ICs for our 133 channels. Has anyone had success with a technique along similar lines? </div>

<div><br></div><div>Alternatively, I could simply remove electrodes from EEG.data until I am left with 64 channels, but I am wary of throwing out data entirely.</div><div><br></div><div>We are running EEGLAB 7.2.9.20b in 64-bit Matlab 7.10.0 (R2010a) in Mac OS X 10.5.7.</div>

<div><br></div><div>Many thanks,</div><div>Keith</div>--<br>Keith Yoder<br>Research Aide<br>Laboratory for the Neuroscience of Autism<br>Cornell University<br>Ithaca, NY<br>574.215.9678<br>
<br><br><div class="gmail_quote">On Mon, Feb 1, 2010 at 5:26 PM, Scott Makeig <span dir="ltr"><<a href="mailto:smakeig@gmail.com" target="_blank">smakeig@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Joe is correct that ICA will not converge if the rank of the data matrix is less than the number of channels. The runica/binica algorithms are supposed to test the rank of the input data. If two channels are identical, or if some subset of n channels are otherwise interdependent, then the rank will be less than the number of channels and PCA reduction should be applied to remove the redundancy and allow the ICA decomposition to converge. <div>


<br></div><div>Arno -- There was a problem with the Matlab rank() function on 64-bit machines, I believe. Has this been solved and Is the auto rank detection -> PCA option currently implemented in runica/binica?  Perhaps we could add a 'toy' rank() function pre-test (e.g. finding the rank of a small full-rank matrix to detect if rank() is working...) ? If so, run the rank test; if not, then warn the user or build a work-around rank function that will work properly?</div>


<div><br></div><div><font color="#888888">Scott</font><div><div></div><div><br><br><div class="gmail_quote">On Mon, Feb 1, 2010 at 6:56 AM, Joseph Dien <span dir="ltr"><<a href="mailto:jdien07@mac.com" target="_blank">jdien07@mac.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
When you say "so long", how long do you mean?  While ICA is not by its nature a fast procedure, certain datasets can take much longer than usual.  For example, I find that if two channels are perfectly correlated (1 or -1) then an ICA run will take much longer.  This can happen if the data is mean mastoid referenced and both channels are explicitly included in the data because they will have a perfect -1 correlation (see Dien, 1998 for reference issues).  It can also happen if a channel is shorted out during acquisition and the reference channel is explicitly included because then they will have a perfect correlation.  Also if two channels are shorted together during the data acquisition they will be perfectly correlated with each other.  My EP Toolkit (<a href="https://sourceforge.net/projects/erppcatoolkit/" target="_blank">https://sourceforge.net/projects/erppcatoolkit/</a>) has code for dealing with these situations so you might want to look into it.  It implements an automated artifact correction routine that relies on EEGlab's runICA code, among!<br>



  other things.<br>
<br>
Cheers!<br>
<br>
Joe<br>
<div><div></div><div><br>
<br>
<br>
On Jan 29, 2010, at 4:49 AM, peng wang wrote:<br>
<br>
> Hi there,<br>
><br>
>    I am using ICA to remove blinks via EEGLab. My dataset has 122 channels, and it takes so long to compute 122 components.<br>
>    (1) So I tried to use the option "ncomps" (say, 24) to reduce the number of components. However, an error message appears after computing: "Matrix dimensions must agree".<br>
><br>
>    (2) Then I tried fastICA instead as following,<br>
><br>
> ==================<br>
>  sz = size(EEG.data);<br>
>  nchans = sz(1);<br>
>  npts = sz(2);<br>
>  ntrials = sz(3);<br>
>  clear sz;<br>
>  nICs = 24;<br>
>  data = reshape(EEG.data,nchans,npts*ntrials);<br>
>  [ica,V,W] = fastica(data,'numOfIC',nICs,'approach','symm');<br>
>  EEG.icasphere = eye(nchans);<br>
>  EEG.icaact = single(reshape(ica,nICs,npts,ntrials));<br>
>  EEG.icawinv = V;<br>
>  EEG.icaweights = W;<br>
>  EEG = eeg_checkset( EEG );<br>
>  clear V W ica data;<br>
><br>
>  EEG = pop_saveset( EEG, 'filename','test_raw_ica');<br>
> ==================<br>
><br>
>    Everything seems fine. But when I reject the blink component via GUI of eeglab and load the data again, Something strange happens. It seems the amplitude of EEG.data become much smaller, about in  -1~1 range.  Thus I wonder whether there was some normalization behind, and how can I correct it? The problem would not repeat if I choose the number of components same as channels event in fast ICA (e.g. change to "nICs = nchans" in the above code).<br>



><br>
>    Thank you for your help.<br>
><br>
> best<br>
> Peng<br>
</div></div>> _______________________________________________<br>
> Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
> To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.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.edu</a><br>
<br>
<br>
--------------------------------------------------------------------------------<br>
<br>
Joseph Dien,<br>
Senior Research Scientist<br>
University of Maryland<br>
7005 52nd Avenue<br>
College Park, MD 20742-0025<br>
<br>
E-mail: <a href="mailto:jdien07@mac.com" target="_blank">jdien07@mac.com</a><br>
Phone: 301-226-8848<br>
Fax: 301-226-8811<br>
<a href="http://homepage.mac.com/jdien07/" target="_blank">http://homepage.mac.com/jdien07/</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.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.edu</a><br>
</blockquote></div><br><br clear="all"><br></div></div><div>-- <br>Scott Makeig, Research Scientist and Director, Swartz Center for Computational Neuroscience, Institute for Neural Computation, University of California San Diego, La Jolla CA 92093-0961, <a href="http://sccn.ucsd.edu/%7Escott" target="_blank">http://sccn.ucsd.edu/~scott</a><br>



</div></div>
<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.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.edu</a><br></blockquote></div><br>
<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br><br clear="all"><br>-- <br>Scott Makeig, Research Scientist and Director, Swartz Center for Computational Neuroscience, Institute for Neural Computation, University of California San Diego, La Jolla CA 92093-0961, <a href="http://sccn.ucsd.edu/~scott">http://sccn.ucsd.edu/~scott</a><br>