-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sequence of different events #71
Comments
begin
c_design = UnfoldSim.SingleSubjectDesign(;conditions= Dict(:duration=>[0.2*sfreq],:shift => 0.2.*sfreq .+ rand(500).*sfreq/3))
r_design = UnfoldSim.SingleSubjectDesign(;conditions= Dict(:duration=>[0.4*sfreq],:shift =>generate(c_design).shift .+ 0.1.*sfreq .+ rand(500).*sfreq/3))
end
p1 = LinearModelComponent(;
basis = p100(),
formula = @formula(0~1),
β = [2]
);
n1 = LinearModelComponent(;
basis = n170(), # negative already
formula = @formula(0~1),
β = [2]
);
p3 =TimeVaryingComponent(basis_shiftduration,200)
c_component = TimeVaryingComponent(basis_shiftduration,200)
s_data,s_evts = simulate(MersenneTwister(1),c_design, [p1,n1], UniformOnset(0,2*sfreq), NoNoise());
r_data,r_evts = simulate(MersenneTwister(1),r_design, [p3], UniformOnset(0,2*sfreq),NoNoise())# CustomOnset(evts.latency .+0.5*sfreq),NoNoise())
c_data,c_evts = simulate(MersenneTwister(1),c_design, [c_component], UniformOnset(0,2*sfreq),PinkNoise(noiselevel=noiselevel)) |
p1 = Component
n1 = Component
p3 = Component
eventA = [p1,n1]
eventB = [p1,p3]
seq = 'AAAB'
repeats=5
evts = generate_events(Design(
sequence = seq
)|>RepeatDesign(x)) # repeatdesign repeats the blocks!
# evts now contains a "protected" field `event`
#evts.event = repeat(['A','A','A','B'],5)
simulate(design,['A'=>eventA,'B'=>eventB],Overlap,Noise) Sequence syntaxmaybe a syntax similar to regex? seq = 'AA[B]{1,3}' # can generate AAB,AABB,AABBB
seq = '[AB]{2}' # can generate AA,AB,BA,BB
seq = '[(AB)]{2}' # can generate ABAB
seq = '[(AB)B]{2}' # can generate ABB ABAB BAB BB Block / non-overlappingsimplest solution could be to have
One thing I havent thought now is how to specify to put as many events as there is time-left. E.g. an 'A' event (stimulus) for 5s, put in as many 'B' (fixation) events as possible. Maybe @jschepers what do you think? |
see #83 for an implementation. |
Currently not clear how to best do something like
A -> B -> C
as three different events, or even worse, B follows A in 80% of cases, etc.The text was updated successfully, but these errors were encountered: