UnfoldSim.jl

Author unfoldtoolbox
Popularity
0 Stars
Updated Last
1 Year Ago
Started In
October 2021

UnfoldSim

Dev Build Status Coverage DOI

A package to simulate single timeseries model-based ERPs, fMRI activity, pupil dilation etc. If you have one channel, it is a timeseries of (overlapping) event-related activity and some noise - you might have fun here!

Many Tutorials, Guides, How-Tos and References available in the documentation!

grafik

Quickstart

data,evts = UnfoldSim.predef_eeg(;n_trials=20,noiselevel=0.8)

Produces continuous "EEG" with PinkNoise and some Overlap between 20 events

Slightly longer

# start by defining the design / event-table
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 Onset Distribution and Noise, and simulate!
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!