Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to implement Granger causality analysis from the time domain? #243

Open
an99xf opened this issue Oct 11, 2024 · 1 comment
Open

Comments

@an99xf
Copy link

an99xf commented Oct 11, 2024

It's great that Granger causality analysis has been incorporated in mne_connectivity.spectral_connectivity_epochs, which supports extensive frequency- and time-frequency-domain connectivity methods. However, Granger causality analysis actually can be done from time-series data (time domain), and this was developed already in Matlab (see Multivariate Granger Causality Toolbox).

Would it be possible to provide an option to implement Granger causality analysis from the time domain?

@tsbinns
Copy link
Collaborator

tsbinns commented Oct 11, 2024

Hi, thanks for your post!

Definitely time domain Granger causality is useful to have. If you don't need it to be multivariate, you should be able to compute time domain GC using the vector_auto_regression() function. This tutorial has more info on how this can be used to compute the covariance of your residuals, which could then be used to compute a Granger score. Admittedly it's a bit more hands-on, but it is possible with the current tools.

I will say, I tried this recently and for the most part it worked, however I did run into some errors/undocumented behaviour which perhaps need to be addressed.

On the other hand, if you want it to be multivariate GC, then that requires new code. It might not be so difficult to implement since the multivariate method we currently use is just the frequency domain extension of the method by the same authors of that MATLAB toolbox you link to.

I will leave it to someone more senior than me to comment on whether they think adding this is appropriate, but if so, personally I likely cannot allocate time to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants