scot-dev / scot

EEG/MEG Source Connectivity Toolbox in Python
http://scot-dev.github.io/scot-doc/index.html
MIT License
58 stars 23 forks source link

time series of independent components #208

Closed NinaOmejc closed 6 months ago

NinaOmejc commented 7 months ago

Hi, thank you for this toolbox.

Is there a way (implemented function) to obtain the time series of the independent components, as is the case with regular ICA? I would like to further use the time series for sLORETA. If not, would that, in general, be the unmixing matrix orig or PCA transformed data (U x)?

Thank you for your help.

cbrnr commented 7 months ago

If I understand your question correctly and you only need the plain ICA components, you don't really need the functionality of SCoT. I recommend that you then use ICA directly from scikit-learn or MNE-Python, depending on which ICA algorithm you want. For example, if you use sklearn.decomposition.FastICA, you can get the sources using the transform() method.

NinaOmejc commented 7 months ago

Thank you for your reply! I see. Well, yes, that would be possible, but the reason I'm concerned with that is, as you say also in the SCoT paper (really good paper btw, thank you), that then the components will be independent and I shouldn't in principle find any connectivity between them (e.g. if I do correlation or transfer entropy calculation). That's why I wanted to try with mvarica. Or am I wrong here?

mbillingr commented 7 months ago

Hi there!

You are right, correlation between ICA components does not make sense because independence implies zero correlation. Although connectivity between ICA components is theoretically possible, you will likely get distorted results. This is why we recommend MVARICA in the paper. (I have to add that I don't know how much distortion to expect in practice, and if it is even enough to be relevant; to my knowledge nobody has yet attempted to quantify that.)

It seems conceivable to use MVARICA as a "better ICA" for connectivity analysis - if the connectivity is based on vector autoregression. If you try to use more general models (non-linear, non-parametric, or just autoregression with higher order) on MVARICA components, I expect results will be distorted again.

Transfer entropy is non-parametric, right? You might get distorted/biased/wrong results when applied to ICA or MVARICA components.

All that said, you can get the time series components. Although there is no function to do so out of the box, it's just a dot product of the transposed unmixing matrix and the original time series: dot(unmixing.T, data)

NinaOmejc commented 6 months ago

Okay, great, thank you for this clarification! I see more clearly now that using nonlinear methods after data has been already transformed to fit the linear model (such as mvar) might affect the results. It might be interesting to check the influence on the simulated data. Thank you again, i think i can close this issue.