mne-tools / mne-connectivity

Connectivity algorithms that leverage the MNE-Python API.
https://mne.tools/mne-connectivity/dev/index.html
BSD 3-Clause "New" or "Revised" License
66 stars 34 forks source link

Add support for additional multivariate methods #155

Open tsbinns opened 8 months ago

tsbinns commented 8 months ago

Now that a general framework for multivariate connectivity is supported following #125 and #142, it would be nice to expand the methods available. Three come to mind:

1. Canonical coherence (multivariate coherence)

Paper: Vidaurre et al. (2019)

This shares many principles with the methods based on the imaginary part of coherency (MIC & MIM) which have already been implemented, but is a more appropriate method for cases where you want to find the relationship between datasets where e.g. volume conduction is not expected to be an issue.

The example they give in the paper looks at EEG and EMG data, however it can also be applied to brain recordings from different modalities (e.g. EEG and subcortical LFP).

Possible challenges?

I do not anticipate any hurdles adding this method (i.e. requires no further API changes, works completely with the multivariate framework currently implemented, tests and examples would be similar to those for MIC).

Our group has the method written up in Python and we have started implementing it with MNE-Connectivity, but I cannot say for sure when we would have a PR available to review this in more detail.

2. Multivariate phase slope index

Paper: Basti et al. (2018)

Adding this was raised back in #102. There is now a multivariate measure of directed connectivity implemented with Granger causality, however PSI is of course a different method.

Possible challenges?

The equations for computing MPSI are pretty simple, so coding this up would not be a problem. I also don't see any problems integrating with the multivariate framework.

The only thing which comes to mind is the fact that PSI involes summing over frequencies. The fmin and fmax arguments could be used to specify the frequency bands over which the results are summed, or the frequency-resolved results could be returned and the end-user could sum over the frequency bands of interest afterwards. Nothing impossible, but worth keeping in mind.

3. Conditional Granger causality

Paper: Barnett & Seth (2015)

Currently, the GC method implemented is unconditional, i.e. accounts for information flow from a group of signals, X, to another group, Y. In contrast, conditional GC accounts for information flow from X to Y conditional on a third group of signals, Z. This is useful if you want to characterise information flow between several groups of signals, e.g. as in Liao et al. (2010).

Possible challenges?

A form of conditional GC exists which is based on the same state-space approach as for the unconditional GC which is currently implemented, so adding the code for this method would not be too much trouble (much of the existing GC code can be used).

What would be trickier is how to index this third set of conditional channels. This could require some API changes, e.g. a new argument cond_indices in spectral_connectivity_epochs and spectral_connectivity_time. Again nothing impossible, but would require some discussion.

Summary

Overall, canonical coherence is the easiest method to add (and the one we would be closest to opening a PR for), but I think the other two are still worth considering.

Very open to comments on these proposals, or if anyone has suggestions for other multivariate methods which should be considered. Cheers!

larsoner commented 8 months ago

Not opposed to adding any of these, just a general comment that anything we add is something that we need the time and expertise to support and fix bugs for. So I'd caution against trying to add everything we can and instead focus on things that people need to have for their workflows. But maybe you need all of these already @tsbinns ?

tsbinns commented 8 months ago

@larsoner, of course, I understand.

Canonical coherence is something myself and a number of other people in my group would definitely find useful, hence why we already started looking into this.

Conditional GC would complement the current GC method nicely, but it is not something I have an immediate use for, so it would not be my priority for coding up.

MPSI I included just because there was an open issue. Personally I do not need this.

As discussed with @adam2392 before, I'm also happy to lend a hand in case any problems with these methods arise for the foreseeable future!

drammock commented 8 months ago

@ruuskas do you have any input here as to which multivariate methods should be prioritized?

agramfort commented 6 months ago

@neurointell you need to understand that the tools you use here are written by academic engineers, phd students, post-doc and professors who allocate a fraction of their time to build an open source ecosystem for better research and science. If you think that the tools is not great enough, then help us to make it better by also giving a fraction of your time to the community.

agramfort commented 6 months ago

👍

Message ID: @.***>