-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Given the simulation in the tutorial with an SR_ complex simulation()
doesn't work for small width/ offset combinations. See the code below for an example which doesn't work.
It seems it's more dependent on the offset than the width, as width = 5; offset = 10
works, but width = 10; offset = 5
does not (width = 40; offset = 5
works again however).
I am not sure if this is intended behaviour, or more a result of how the SequenceDesign is implemented (it's likely the latter), but there should be at least a @assert
at one point.
Done with PR #112
using UnfoldSim, Random
sfreq = 100
width = 5
offset = 5
n_trials = 10
p1 = LinearModelComponent(;
basis=p100(; sfreq=sfreq),
formula=@formula(0 ~ 1),
β=[5]
)
n1 = LinearModelComponent(;
basis=n170(; sfreq=sfreq),
formula=@formula(0 ~ 1),
β=[5],
)
p3 = LinearModelComponent(;
basis=p300(; sfreq=sfreq),
formula=@formula(0 ~ 1 + condition),
β=[7, 2],
)
resp = LinearModelComponent(;
basis=UnfoldSim.hanning(Int(0.5 * sfreq)), # sfreq = 100 for the other bases
formula=@formula(0 ~ 1),
β=[6],
offset=-10,
)
components = Dict('S' => [p1, n1, p3], 'R' => [resp])
# Design
cond_dict = Dict(:condition => ["one", "two"])
design = SingleSubjectDesign(conditions=cond_dict)
design = SequenceDesign(design, "SR_")
design = RepeatDesign(design, n_trials) # number of trials will be n_trials * 2
# Simulate
data, evts = simulate(
MersenneTwister(1),
design,
components,
UniformOnset(offset=offset, width=width),
PinkNoise(; noiselevel=5),
)
Metadata
Metadata
Assignees
Labels
No labels