question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Time-domain asymmetric dynamical connectivity - data structure storage and basic OLS algorithms

See original GitHub issue

Describe the new feature or enhancement

This is related to a goal of mine to add generic “connectivity” function to MNE for the code-sprint.

Right now, there are a decent amount of “spectral connectivity” (possibly over time) metrics derived from raw EEG/MEG/iEEG data.There are alternative characterizations, such as dynamical system perspective, which models the data as:

x(t+1) = Ax(t)

where A is possibly an asymmetric matrix characterized by its eigenvalues. Note this is different then just looking at the “pearson correlation” (or covariances) over time, since correlation matrices are PSD and symmetric.

Since a linear dynamical system representation of the MEEG data is useful, it would be nice to have a “data structure” to store such a representation and also expose basic algorithms for estimating this model from the raw data. I’m opening this issue to have a discussion to see if this is feasible to add.

Describe your proposed implementation

One can leverage scikit-learn to add an option to say Raw, or Epochs.

One can add regularization as a result. The algorithm would essentially consist of a window_size and step_size, which takes a sliding window and estimates sequences of these A matrices.

To make this a “nice” and “useful” workflow, I would argue that we need a:

  • general Connectivity container (e.g. generalize what Connectivity data structures mne already has)
  • a simple API for computing the sequence of A matrices

Describe possible alternatives

In a related viewpoint, this is related to what is known as Dynamic Mode Decomposition (DMD), which is also useful, but the representation of the data is different, because there one is interested in not only the A matrix, but also the “DMD modes”. This is related to the linear Koopman operator in dynamical systems theory; DMD is a finite approximation of Koopman.

Example paper:

Additional comments

Example papers using A matrix:

In addition https://arxiv.org/pdf/1802.08334.pdf talks about the convergence of such OLS estimates for A, giving some sort of theoretical guarantees on how “estimable” an A matrix is from MEEG data.

Comparisons to spectral connectivity

Spectral connectivity generally are defined as some correlation measure over frequency domain, and is generally symmetric. Here, I am proposing a time-domain and possibly ``asymmetric` “connectivity” derivative of the raw MEEG data.

Testing

Datasets can be tested against A matrices I’ve computed using numpy.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:23 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
agramfortcommented, Mar 22, 2021

I would start from https://github.com/mne-tools/mne-project-template

and start putting there the various connectivity measure we have in mne-python and elsewhere

after the first release of “mne-connectivity” we should start deprecating the mne.connectivity module.

my 2c

1reaction
adam2392commented, Mar 19, 2021

Btw @alexrockhill spoke with @agramfort and he’s opposed to adding this type of functionality into MNE-python. He thinks that it might be useful for a sub-group of us to try to band together w/ scot, and ppl here https://github.com/mne-tools/mne-python/issues/9030#issuecomment-802110862 to basically implement a 3rd-party mne-connectivity stand-alone package that:

  1. takes out the current mne.connectivity module
  2. implements anything suggested here e.g. state-space / lds modeling

I’m pretty open to this idea if there’s enough ppl game. However, for my purposes I really only use lds modeling…

Read more comments on GitHub >

github_iconTop Results From Across the Web

The dynamics of resting fluctuations in the brain: metastability ...
This theoretical framework has been largely successful in explaining the highly structured dynamics arising from spontaneous brain activity ...
Read more >
CSC 229 Data Structures & Algorithms I
This course is the first of a two course sequence that teaches students to efficiently apply programming techniques to problems commonly ...
Read more >
Dynamic coherence analysis of resting fMRI data to jointly ...
Here we propose a novel data-driven framework to estimate time-varying patterns of whole-brain functional network connectivity of resting state ...
Read more >
Available CRAN Packages By Name
Available CRAN Packages By Name ; AgroR, Experimental Statistics and Graphics for Agricultural Sciences ; AgroReg, Regression Analysis Linear and Nonlinear for ...
Read more >
https://www.scopus.com/scopus/inward/record.url?pa...
No information is available for this page.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found