You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question concerning the "component parameters" in ICA, which are n_components, max_pca_components, and n_pca_components. What exactly do they do?
I understand that an ICA of say 64-channel EEG data will usually yield a W of size 64. From my current knowledge the ways how to end up with W of a lower size would be:
to perform a dimension reduction with PCA prior to ICA application
to "subsample" the sensor space, that is, drop some channels and apply only this subset to ICA
Now the three mentioned parameters to the ICA object are confusing me a bit.
max_pca_components --> this is probably corresponding to my point 1), a dimension reduction and it will select the n components of the PCA that explain the most of the variance (or all components).
If that is true, what is n_components doing?
Lastly, what is n_pca_components doing? It says that it is:
The number of PCA components used after ICA recomposition.
... but why would any PCA components be of relevance after I already back-projected my ICA (I assume that is what is meant by recomposition)? Does this parameter perhaps have something to do with the problem that is mentioned in the recent paper that warns about performing dimension reduction prior to ICA?
@sappelhoff I completely agree that these arguments are confusing - for an ongoing discussion please see #4856. Here's the tl;dr:
n_components and max_pca_components both perform dimensionality reduction via PCA prior to ICA. The only difference between these two arguments is the shape of the returned PCA components matrix (with n_components you get all components, whereas with max_pca_components you get only the selected components, i.e. rows, in this matrix). For the user, I'd recommend to use n_components.
You are right that n_pca_components is used in back-projecting. I still haven't figured out why exactly this argument is necessary.
We haven't finished our discussion in #4856 (feel free to participate), but at the very least, we will clarify these arguments in the docs and contrast them to equivalent EEGLAB arguments.
retain max_pca_components and project X to X_reduced
at this point, probably n_components is doing something ... but what?
Using X_reduced, we compute an ICA and have X_reduced_ica
From X_reduced_ica, we retain/reject components
We back-project X_reduced_ica using the ICA weights and have X_reduced'
( the ' indicating that some components were rejected in the ICA ... but the dimensions are the same)
X_reduced' can now be back-projected to X' using the PCA weights of dimension max_pca_components
(It would be X' instead of the original X because of two reasons: (a) some ICA components were missing (rejected) to get the same X_reduced and (b) X_reduced does not contain all pca components so we cannot recover all the data)
Here, at step 7., n_pca_components comes into play by using more than just max_pca_components to construct X' from X_reduced'
Is my intuition about the procedure correct? Given that yes, ... are there any references that suggest that step 8. (concerning max_pca_components) is sensible? And I still don't know what n_components is doing ... but for now, I will not do any dimension reduction anyway and leave the arguments at None.
However, given the discussion in #4856 and this paper that I also linked above, maybe we should include a warning that performing dimensionality reduction (even only by 1% variance) before ICA can lead to unreliable results? That information might fit well next to the warning note about filters ... ?
I'm not sure if your intuition is correct, this is exactly what I was trying to find out as well 😄. To avoid discussing this in two places, could you please comment in #4856 (and @agramfort you could close this issue then)?
Regarding the warning, we could include a note with a link to that paper, but there is one use case where you should reduce dimensionality, namely if you have rank-deficient data such as after average reference. In this case, it is strongly recommended to reduce dimensionality by 1, otherwise ICA might not work optimally if it doesn't detect this situation (see here). The note would have to take this into account.
Activity
agramfort commentedon Mar 29, 2018
for @cbrnr :)
cbrnr commentedon Mar 29, 2018
@sappelhoff I completely agree that these arguments are confusing - for an ongoing discussion please see #4856. Here's the tl;dr:
n_componentsandmax_pca_componentsboth perform dimensionality reduction via PCA prior to ICA. The only difference between these two arguments is the shape of the returned PCA components matrix (withn_componentsyou get all components, whereas withmax_pca_componentsyou get only the selected components, i.e. rows, in this matrix). For the user, I'd recommend to usen_components.n_pca_componentsis used in back-projecting. I still haven't figured out why exactly this argument is necessary.We haven't finished our discussion in #4856 (feel free to participate), but at the very least, we will clarify these arguments in the docs and contrast them to equivalent EEGLAB arguments.
sappelhoff commentedon Mar 29, 2018
thanks for the reference, @cbrnr!
Now my current understanding is:
Xmax_pca_componentsand projectXtoX_reducedn_componentsis doing something ... but what?X_reduced, we compute an ICA and haveX_reduced_icaX_reduced_ica, we retain/reject componentsX_reduced_icausing the ICA weights and haveX_reduced''indicating that some components were rejected in the ICA ... but the dimensions are the same)X_reduced'can now be back-projected toX'using the PCA weights of dimensionmax_pca_componentsX'instead of the originalXbecause of two reasons: (a) some ICA components were missing (rejected) to get the sameX_reducedand (b)X_reduceddoes not contain all pca components so we cannot recover all the data)n_pca_componentscomes into play by using more than justmax_pca_componentsto constructX'fromX_reduced'Is my intuition about the procedure correct? Given that yes, ... are there any references that suggest that step 8. (concerning
max_pca_components) is sensible? And I still don't know whatn_components is doing... but for now, I will not do any dimension reduction anyway and leave the arguments at None.However, given the discussion in #4856 and this paper that I also linked above, maybe we should include a warning that performing dimensionality reduction (even only by 1% variance) before ICA can lead to unreliable results? That information might fit well next to the warning note about filters ... ?
cbrnr commentedon Mar 29, 2018
I'm not sure if your intuition is correct, this is exactly what I was trying to find out as well 😄. To avoid discussing this in two places, could you please comment in #4856 (and @agramfort you could close this issue then)?
Regarding the warning, we could include a note with a link to that paper, but there is one use case where you should reduce dimensionality, namely if you have rank-deficient data such as after average reference. In this case, it is strongly recommended to reduce dimensionality by 1, otherwise ICA might not work optimally if it doesn't detect this situation (see here). The note would have to take this into account.