mne-tools / mne-tools/mne-python
Simulation of multivariate activation patterns based on experimental effects
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading SPM’s DEMO_CVA_RSA.m, the linked meeg_simulator implementation, and its tutorial notebook to understand the proposed simulation API and time-resolved effects. Before implementation, establish whether this belongs in MNE-Python or a separate toolbox and define the initial scope; done should include an agreed API returning mne.Epochs objects with documented behavior and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100