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

Simulation of multivariate activation patterns based on experimental effects #13168

Open
AlexLepauvre opened this issue Mar 19, 2025 · 2 comments
Labels

Comments

@AlexLepauvre
Copy link
Contributor

Describe the new feature or enhancement

I would like to propose adding a time-resolved multivariate simulation function to MNE-Python, based on the approach implemented in SPM’s DEMO_CVA_RSA.m. This method provides a simple framework for simulating structured multivariate activity patterns.

This feature extends their methodology by introducing time-resolved effects to simulate dynamic experimental manipulations in EEG/MEG data. The simulated data would be returned as mne.Epochs objects, making it seamlessly compatible with existing MNE analysis pipelines.

Simulated EEG/MEG data is useful for:

  • Validating multivariate decoding and RSA methods.
  • Evaluating statistical robustness of EEG/MEG preprocessing techniques.
  • ....

Describe your proposed implementation

I have created a separate repository with a basic implementation with a tutorial notebook showcasing its use. It's a simple function taking an experimental design, a noise parameter, number of channels, number of subjects, the effects that are supposed to be present as well as the time point at which those are supposed to be present

Describe possible alternatives

I am currently considering the following improvements to what is currently there:

  • Estimate spatial covariance from mne sample data sets
  • Derive ERP from real data to make the simulated time resolved responses more reasonable (simple additive ERPs for each channel on top of the effects defined through FIR)
  • Allow users to specify any basis function they see fit, rather than hard coding FIR within trial design matrix

Additional context

This was done in collaboration with @qian-chu and we intend to write a small methods paper in JOSS to document the function.

We are unsure whether this should be incorporated in mne or be a separate toolbox. In the current state, the code is quite light, but we might consider adding features and expanding the code base:

  • Simulate effects in specific frequency bands
  • Forward modelling
  • Simulate recording noise and artifacts (line noise, blinks...) to test entire preprocessing pipelines
@qian-chu
Copy link
Contributor

Thanks Alex! I just want to add that if the community see benefits in it being a MNE function, we can maybe initiate a PR to add the function to mne/simulation

@larsoner
Copy link
Member

See also #12980. I think the class of possible things to simulate is quite large... maybe now is a good time to split off so things like this can be implemented more quickly!

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

No branches or pull requests

3 participants