nbara / python-meegkit

🔧🧠 MEEGkit: MEG & EEG processing toolkit in Python
https://nbara.github.io/python-meegkit/
BSD 3-Clause "New" or "Revised" License
186 stars 51 forks source link

Impact of component number on topographies and time courses #43

Closed OleBialas closed 3 years ago

OleBialas commented 3 years ago

I have a conceptual question - why does the number of components (the keep1 parameter) influence the outcome of the dss? If I understood the approach correctly it is essentially a PCA that finds the components with maximal power relative to the bias filter. If that is the case, shouldn't the first components always look the same, no matter how many I keep in total? From my data I get very different results when changing keep1.

for example, these are the first 4 components after the dss1 with keep1=5: 5_components

and these are the first 4 components with keep1=15: 15_components

Is this behavior expected?

nbara commented 3 years ago

Hi @OleBialas

This is a visual representation of the steps performed by DSS (from de Cheveigné & Parra, 2014) :

alt text

You can see there are 2 PCA steps involved. nkeep1 specifies the number of components to keep in these two PCAs, not in the overall DSS algorithm.

One you have truncated your data after the first PCA, the second PCA will naturally not look the same.

I would not suggest you change the nkeep1 parameter unless you have good reason to do so (for example if you have many many channels with lots of redundancy). In your case I would probably stick with nkeep1=None which keeps all (non-negligible) components.

OleBialas commented 3 years ago

I am aware of the paper - I actually tried to implement the algorithm myself until I found this nice package :)

I thought the keep parameter refers to the components kept after the final rotation (since the paper does not mention rejecting components after the first PCA), which can then be used for a second rotation to enhance the difference between conditions.

If the rejection happens after the first PCA it's perfectly clear why the results look different - thank you!