# Applying ICA without PCA first

**URL:** <https://mne.discourse.group/t/applying-ica-without-pca-first/3665>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg, ica\
**Created:** [September 7, 2021, 9:24am UTC](https://mne.discourse.group/t/applying-ica-without-pca-first/3665 "2021-09-07T09:24:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MathieuSch-101](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mathieusch-101/32/367_2.png) [@MathieuSch-101](https://mne.discourse.group/u/MathieuSch-101)\
**Post date:** [September 7, 2021, 9:24am UTC](https://mne.discourse.group/t/applying-ica-without-pca-first/3665/1 "2021-09-07T09:24:15Z")

</div>

According to the [ICA tutorial](https://mne.tools/stable/auto_tutorials/preprocessing/40_artifact_correction_ica.html), ICA is applied following a PCA step. I assume the reason is to reduce the dimensionality and speed up the ICA fitting.

However, according to [this paper](https://pubmed.ncbi.nlm.nih.gov/29526744/), applying a PCA before the ICA can harm the data quality and the subsequent ICA, even if only 1% of the total variance is removed.

What are your thoughts about this, and is there a way to apply an ICA only directly in MNE; or do I have to retrieve the data matrix and perform the ICA with scikit-learn?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [September 7, 2021, 12:43pm UTC](https://mne.discourse.group/t/applying-ica-without-pca-first/3665/2 "2021-09-07T12:43:37Z")

</div>

Hello,

you are correct in that in MNE-Python, PCA is always conducted before the actual ICA step. This is slightly different than e.g. in EEGLAB.

In MNE 0.23, this PCA step is **not** used to reduce dimensionality of the data prior to ICA.

How many PCA components will be retained during **signal reconstruction** can be controlled via the `n_pca_components` parameter of `ICA.apply()`. Since MNE-Python 0.23, **all** PCA components are kept, even if the number differs from the number of ICA components.

So to answer your question, in MNE 0.23, no dimensionality reduction is performed via PCA, neither before ICA, nor during signal reconstruction, at least as long as you use the defaults.

---

<div class="post-metadata">

**Author:** ![MathieuSch-101](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mathieusch-101/32/367_2.png) [@MathieuSch-101](https://mne.discourse.group/u/MathieuSch-101)\
**Post date:** [September 7, 2021, 12:56pm UTC](https://mne.discourse.group/t/applying-ica-without-pca-first/3665/3 "2021-09-07T12:56:25Z")

</div>

@richard Alright. Indeed now I remember that the remaining PCA components are added back to avoid dimensionality reduction. But then why is PCA even applied?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [September 7, 2021, 1:21pm UTC](https://mne.discourse.group/t/applying-ica-without-pca-first/3665/4 "2021-09-07T13:21:39Z")

</div>

> [@MathieuSch-101](#):
>
> But then why is PCA even applied?

To allow users to only use a subset of PCA components for signal reconstruction, as a means to improve SNR – at least that’s how I understand it. @Denis probably knows more 🙂

---

<div class="post-metadata">

**Author:** ![Denis](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/denis/32/1155_2.png) [@Denis](https://mne.discourse.group/u/Denis)\
**Post date:** [September 7, 2021, 3:28pm UTC](https://mne.discourse.group/t/applying-ica-without-pca-first/3665/5 "2021-09-07T15:28:22Z")

</div>

It depends a bit on the algorithm, ICA is often implemented on top of PCA and usually you do not see that as a user. Here it is explicit as it gives more fine-grained control of the preprocessing and component handling.
