rERP | EEG visualisation | EEG Simulations | BIDS pipeline | Decode EEG data | Statistical testing |
---|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
A Julia package to simulate multivariate time series, e.g. model-based ERPs, fMRI activity, pupil dilation etc. UnfoldSim.jl provides multi-channel support via EEG-forward models. Moreover, it is possible to simulate overlapping event-related activity and to add noise of a certain type e.g. Pink noise.
Many tutorials, guides, how-tos and references are available in the documentation!
using Pkg
Pkg.add("UnfoldSim")
using UnfoldSim
data, events = UnfoldSim.predef_eeg(; n_repeats = 1, noiselevel = 0.8)
Produces continuous "EEG" with PinkNoise and some overlap between 20 events (2 conditions * 10 levels of the continuous variable).
using UnfoldSim
using Random
# Start by defining the design / events data frame
design =
SingleSubjectDesign(; conditions = Dict(:condA => ["levelA", "levelB"])) |>
d -> RepeatDesign(d, 10);
# Next define a ground truth signal + relation to events/design with Wilkinson formulas
signal = LinearModelComponent(;
basis = [0, 0, 0, 0.5, 1, 1, 0.5, 0, 0],
formula = @formula(0 ~ 1 + condA),
Ξ² = [1, 0.5],
);
# finally, define some inter-onset distribution and noise, and simulate data!
data, events = simulate(
Random.MersenneTwister(1),
design,
signal,
UniformOnset(; offset = 5, width = 4),
PinkNoise(),
);
All components (design, components, onsets, noise) can be easily modified and you can simply plugin your own!
Contributions of any kind are very welcome. Please have a look at CONTRIBUTING.md for guidance on contributing to UnfoldSim.jl.
This project follows the all-contributors specification. Please reach out, if you have contributed to UnfoldSim.jl but we have not listed you as a contributor yet.
TBA
Funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under GermanyΒ΄s Excellence Strategy β EXC 2075 β 390740016. Furthermore, the authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Judith Schepers.