mne-connectivity icon indicating copy to clipboard operation
mne-connectivity copied to clipboard

[ENH, WIP] Add Estimation of Significant Connectivity

Open alexrockhill opened this issue 3 years ago • 12 comments

PR Description

Fixes https://github.com/mne-tools/mne-connectivity/issues/96.

Merge checklist

Maintainer, please confirm the following before merging:

  • [ ] All comments resolved
  • [ ] This is not your own PR
  • [ ] All CIs are happy
  • [ ] PR title starts with [MRG]
  • [ ] whats_new.rst is updated
  • [ ] PR description includes phrase "closes <#issue-number>"

alexrockhill avatar Jun 21 '22 20:06 alexrockhill

@adam2392, if you want to review this, that would be great. I'll link the artifact when it renders.

I'm not sure what to make of the data and also how to correct for multiple comparisons to have a reasonable estimation of greater-than-chance connectivity. I think a cross-validation approach might be a bit cleaner, that's going to take even more compute time though...

alexrockhill avatar Jun 21 '22 20:06 alexrockhill

https://output.circle-artifacts.com/output/job/5f2842e0-889a-4712-99e6-a3e81f5b795f/artifacts/0/dev/auto_examples/dynamic/mne_var_connectivity.html#sphx-glr-auto-examples-dynamic-mne-var-connectivity-py

alexrockhill avatar Jun 21 '22 20:06 alexrockhill

@adam2392 , when you have a chance, what do you think about this? I'm not sure the results make sense, perhaps it would be easier to use an example dataset where the brain activity is more well-known like MNE sample? That way you should see audio and visual connectivity to know things are generally sensible...

alexrockhill avatar Jul 05 '22 17:07 alexrockhill

Sorry for the delay @alexrockhill . I was out of country on vacation till last night.

So I think overall this is a useful feature since the time-shuffled idea works in practice if you have some type of stationarity and you're interested in just estimating 1 connectivity pattern. I think the issue is interpreting it for this specific example.

Perhaps one thing we can say is the 'AST' channel region consistently has significant connections, which is interesting considering that region was "considered" epileptic by the clinicians. Reference: https://openneuro.org/datasets/ds003029

A few minor comments:

  • why are there multiple color bars?
  • can we make the plot a bit bigger to show the actual channel labels?

adam2392 avatar Jul 11 '22 22:07 adam2392

Sorry for the delay @alexrockhill . I was out of country on vacation till last night.

It's all good, I hope you had a good time!

So I think overall this is a useful feature since the time-shuffled idea works in practice if you have some type of stationarity and you're interested in just estimating 1 connectivity pattern. I think the issue is interpreting it for this specific example.

Perhaps one thing we can say is the 'AST' channel region consistently has significant connections, which is interesting considering that region was "considered" epileptic by the clinicians. Reference: https://openneuro.org/datasets/ds003029

Oh super interesting, so maybe we should stick with this. If we do that, would you mind writing some of the interpretation?

A few minor comments:

  • why are there multiple color bars?

Because things don't work properly :) I can look into it

  • can we make the plot a bit bigger to show the actual channel labels?

Yeah I think so it would just take a bit of doing.

alexrockhill avatar Jul 11 '22 22:07 alexrockhill

Oh super interesting, so maybe we should stick with this. If we do that, would you mind writing some of the interpretation?

Sounds good! Can do. Ping me when you have the other issues fixed and I'll add some inline comments to the text?

adam2392 avatar Jul 12 '22 17:07 adam2392

Oh super interesting, so maybe we should stick with this. If we do that, would you mind writing some of the interpretation?

Sounds good! Can do. Ping me when you have the other issues fixed and I'll add some inline comments to the text?

I don't think the other issues really effect the interpretation so go for it whenever. I can work on fixing those next week.

alexrockhill avatar Jul 12 '22 17:07 alexrockhill

@alexrockhill how's this going?

Are my additions sufficient for what you were thinking?

adam2392 avatar Jul 18 '22 19:07 adam2392

I think it's close, I haven't had a chance to look into the failures. I think it's a bit hand wavy for my taste for package documentation, it would be nice if there was a bit more understanding of the connectivity and not just 'that looks somewhat reasonable'.

alexrockhill avatar Jul 18 '22 19:07 alexrockhill

True, but that's a limitation in general for correlation based connectivity analysis.

I think as long as the assumption of stationarity is said, then the time shuffling is theoretically sound and not hand wavy.

The caveat is in practice you don't know whether or not something is stationary.

adam2392 avatar Jul 18 '22 20:07 adam2392

Hey @adam2392, I had a minute to work on this but the results seem a bit odd; the connectivity of the null distribution are very non-normally distributed, most values are below ten and then some are in the hundred thousand or millions. I'm not sure how to account for this, it seems very difficult to compute reasonable statistics if these are the actual values... if you have a minute, it would be great if you could give it a run and see if you have any advice on how to make things more reasonable.

Also, unrelatedly, looks like the CIs need some fixes.

alexrockhill avatar Oct 21 '22 20:10 alexrockhill

Hey @alexrockhill sorry for the late reply.

Statistical testing with especially non-symmetric connectivity matrices is a pretty challenging problem, so I'm not 100% sure how I would go about this tbh. I'm wary of trying too hard to make it work because I'm not that familiar with permutation block shuffling to do inference on connectivity matrices.

adam2392 avatar Nov 18 '22 03:11 adam2392