Skip to main content

A package for simulating time resolved data with multivariate effects

Project description

MultiSim

Simulate realistic MEG/EEG data with ground-truth multivariate effects

Installation

pip install multisim-neuro

Or clone and install the development version:

git clone https://github.com/AlexLepauvre/multisim-neuro
cd multisim-neuro
pip install -e .[full]

Features

  • Design-driven simulation: specify arbitrary experimental design matrices (conditions, interactions, parametric regressors).

  • Time‑locked effects: inject multivariate patterns in chosen time windows with exact control over effect size (Mahalanobis distance).

  • Noise modeling: control within‑subject sensor noise and between‑subject variability.

  • Spatial covariance: simulate correlated sensors or modes via any user‑supplied covariance matrix.

  • MNE & EEGLAB export: seamless conversion to mne.EpochsArray or EEGLAB .set files.

  • Power analysis: predict group‑level statistical power from trials, subjects, and effect sizes.

Quickstart

import numpy as np
from multisim import Simulator

# 1. Create a simple design: two conditions, 100 trials
X = np.vstack([np.zeros(100), np.ones(100)]).T  
t_win   = np.array([[0.1, 0.3]])    # effect between 100–300 ms
effects = np.array([1])             # effect on condition 1

# 2. Instantiate simulator
sim = Simulator(
    X, noise_std=1.0, n_channels=64, n_subjects=10,
    tmin=-0.2, tmax=0.8, sfreq=250,
    t_win=t_win, effects=effects,
    effect_size=[0.5],               # multivariate d′ = 0.5
    intersub_noise_std=0.1           # between-subject σ
)

# 3. Export to MNE Epochs and decode
epochs_list = sim.export_to_mne()
# ... run your decoding pipeline on epochs_list ...

API

After installation, see full class and method documentation at: https://alexlepauvre.github.io/multisim-neuro/index.html

You can find extensive tutorials at: https://alexlepauvre.github.io/multisim-neuro/tutorial/index.html

Customization

  • Spatial pattern: pass a custom covariance matrix or weight vector to concentrate signal in subsets of channels.

  • Temporal kernel: supply any causal kernel to shape the time-course of effects.

  • Effect size: Simulate multivariate effect at particular effect size to test the ability of your pipelines to retrieve it given the number of subjects and trials for each subject

How to cite us:

If you use the scripts found in this repository, you can use the DOI provided by Zenodo to cite us. And here is a bibtex:

@article{LepauvreEtAl2024,
  title = {MultiSim},
  author = {Lepauvre, Alex and Chu, Qian and Zeidman, Peter and Melloni, Lucia},
  year = {2025},
  doi = {TBA},
}

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multisim_neuro-0.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multisim_neuro-0.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file multisim_neuro-0.1.tar.gz.

File metadata

  • Download URL: multisim_neuro-0.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for multisim_neuro-0.1.tar.gz
Algorithm Hash digest
SHA256 ecc2632809d645f3510962416e8e38c837d7ad343337512aeb554742ce2c8186
MD5 b1597e063f1c3e374420db478fdcb7ba
BLAKE2b-256 9676fe6abd9131216c499e4c7d7ce40909b30aa87075e195672552c7e3d2314e

See more details on using hashes here.

Provenance

The following attestation bundles were made for multisim_neuro-0.1.tar.gz:

Publisher: publish-pypi.yml on AlexLepauvre/multisim-neuro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file multisim_neuro-0.1-py3-none-any.whl.

File metadata

  • Download URL: multisim_neuro-0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for multisim_neuro-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b27c1160b1cfacc5691b340b1707c7a8c2fcf5a9e466c165fad829943b62e2c2
MD5 3c245ec4028ba372a01888cf8c202135
BLAKE2b-256 f2d9e737697a990e0229c28dbc97528935385b45d095f87ec6de67411f84c34f

See more details on using hashes here.

Provenance

The following attestation bundles were made for multisim_neuro-0.1-py3-none-any.whl:

Publisher: publish-pypi.yml on AlexLepauvre/multisim-neuro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page