- 
                Notifications
    You must be signed in to change notification settings 
- Fork 7
Feature sequential sampling models #139
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
base: v4.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an intermediate review, I'm running out of time, but I didnt check everything yet
Wording DocString Co-authored-by: Benedikt Ehinger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
Line 370 in a0f9253
| end | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 29 to 38 in a0f9253
| drift_rate::Union{Real, String} # drift rate | |
| event_onset::Union{Real, String} # onset(sensory evidence) | |
| sensor_encoding_delay::Union{Real, String} # var(sensory encoding delay) | |
| accumulative_level_noise::Union{Real, String} # accum level noise | |
| boundary::Union{Real, String} # boundaryary height | |
| motor_onset::Union{Real, String} # onset(motor) | |
| motor_delay::Union{Real, String} # var(motor) | |
| post_accumulation_duration_mean::Union{Real, String} # mean(post decision) | |
| post_accumulation_duration_variability::Union{Real, String} # var(post decision) | |
| CPPrampdownDur::Union{Real, String} # CPPrampdown duration | 
[JuliaFormatter] reported by reviewdog 🐶
| CPPrampdownDur = 0.1 | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 53 to 55 in a0f9253
| return new(drift_rate, event_onset, sensor_encoding_delay, accumulative_level_noise, boundary, motor_onset, | |
| motor_delay, post_accumulation_duration_mean, post_accumulation_duration_variability, | |
| CPPrampdownDur) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 82 to 84 in a0f9253
| return Dict( | |
| name => getfield(model, name) for name in fieldnames(typeof(model)) | |
| ) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 111 to 122 in a0f9253
| evidence = zeros(length(time_vec)); | |
| evidence[time_vec .>= (model.event_onset+(rand(rng) -.5)*model.sensor_encoding_delay)] .= 1; | |
| startAccT = time_vec[findfirst(evidence .== 1)]; | |
| noise = vcat(zeros( | |
| sum(time_vec .< startAccT)), | |
| randn(rng,sum(time_vec .>= startAccT)) .* model.accumulative_level_noise .*sqrt(Δt)); | |
| ev=evidence; | |
| ev[time_vec .< startAccT] .= 0; # set to zero all of the evidence before accT | |
| cum_evidence = cumsum(ev .* model.drift_rate .* Δt .+ noise,dims=1); # This is the cumulative differential evidence, just as in a 1d DDM. | |
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 124 to 125 in a0f9253
| cum_evidence = abs.(cum_evidence); | |
| dti = findfirst(cum_evidence .> model.boundary); # finding the sample point of threshold crossing of each, then will pick the earlier as the winner | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 130 to 131 in a0f9253
| rt = time_vec[dti] + model.motor_onset + (rand(rng)-.5) * model.motor_delay; | |
[JuliaFormatter] reported by reviewdog 🐶
| post_acc_duration = model.post_accumulation_duration_mean .+ model.post_accumulation_duration_variability .* rand(rng); | 
[JuliaFormatter] reported by reviewdog 🐶
| acc_stop_index = dti + (post_acc_duration÷Δt)|>Int; | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 139 to 140 in a0f9253
| cum_evidence = abs.(cum_evidence); | |
| if acc_stop_index<length(time_vec) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/src/sequentialSamplingModelSimulation.jl
Lines 142 to 143 in a0f9253
| tmp = cum_evidence[acc_stop_index] .- (1:(nT-acc_stop_index)) .*cum_evidence[acc_stop_index] .* (Δt ./ model.CPPrampdownDur) | |
| cum_evidence[(acc_stop_index+1):end] .= max.(Ref(0), tmp); | 
[JuliaFormatter] reported by reviewdog 🐶
| return rt/Δt, cum_evidence[1:end] | 
[JuliaFormatter] reported by reviewdog 🐶
| function trace_sequential_sampling_model(rng, component::Drift_Component, design::AbstractDesign) | 
[JuliaFormatter] reported by reviewdog 🐶
| model = component.model_type(; (key => parameters[key] for key in keys(parameters))...) | 
[JuliaFormatter] reported by reviewdog 🐶
| rt = (time_steps[end] + model.τ)/Δt | 
[JuliaFormatter] reported by reviewdog 🐶
| rt = (time_vec[end] + model.τ)/Δt | 
[JuliaFormatter] reported by reviewdog 🐶
| rt = (time_steps[end] + model.τ)/Δt | 
[JuliaFormatter] reported by reviewdog 🐶
| end | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/component.jl
Lines 49 to 59 in a0f9253
| # Test UnfoldSim.simulate_component(rng, c::Drift_Component, design::AbstractDesign) | |
| boundary = 1.0 | |
| model_parameter = UnfoldSim.create_kelly_parameters_dict(UnfoldSim.KellyModel(boundary=boundary)); | |
| c = Drift_Component(simulate_component, 0:1/500:1.0, 1/500, KellyModel, model_parameter); | |
| design_single = UnfoldSim.SingleSubjectDesign(conditions = Dict(:condition => [1])); | |
| design_seq = UnfoldSim.SequenceDesign(design_single,"SCR_"); | |
| result_traces = UnfoldSim.simulate_component(StableRNG(1),c,design_seq) | |
| @test size(result_traces) == (501, 3) | |
| @test any(result_traces .== 0) | |
| @test any(result_traces .>= boundary) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/component.jl
Lines 61 to 67 in a0f9253
| # Test UnfoldSim.simulate_component(rng, c::Drift_Component, design::AbstractDesign) | |
| boundary = 1.0 | |
| model_parameter = UnfoldSim.create_kelly_parameters_dict(UnfoldSim.KellyModel(boundary=boundary)); | |
| c = Drift_Component(simulate_component, 0:1/500:1.0, 1/500, KellyModel, model_parameter); | |
| design_single = UnfoldSim.SingleSubjectDesign(conditions = Dict(:drift_rate => [0.5, 0.8], :condition => [1])); | |
| design_seq = UnfoldSim.SequenceDesign(design_single,"SCR_"); | |
| result_traces = UnfoldSim.simulate_component(StableRNG(1),c,design_seq) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/component.jl
Lines 69 to 71 in a0f9253
| @test size(result_traces) == (501, 6) | |
| @test any(result_traces .== 0) | |
| @test any(result_traces .>= boundary) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/component.jl
Lines 73 to 81 in a0f9253
| # Test calculate_response_times_for_ssm(rng, component::Drift_Component, design::AbstractDesign) | |
| model_parameter = UnfoldSim.create_kelly_parameters_dict(UnfoldSim.KellyModel()); | |
| c = Drift_Component(simulate_component, 0:1/500:1.0, 1/500, KellyModel, model_parameter); | |
| design_single = UnfoldSim.SingleSubjectDesign(conditions = Dict(:drift_rate => [0.5, 0.8], :condition => [1])); | |
| design_seq = UnfoldSim.SequenceDesign(design_single,"SCR_"); | |
| sub_design = UnfoldSim.SubselectDesign(design_seq, 'C') | |
| result_rts = UnfoldSim.calculate_response_times_for_ssm(StableRNG(1),c,sub_design) | |
| @test size(result_rts) == (2,) | |
| @test isapprox(result_rts, [399.6903067274333, 388.89617910657597], atol=1e-8) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/component.jl
Lines 83 to 90 in a0f9253
| # Test get_model_parameter(rng, evt, d::Dict) | |
| rng = StableRNG(1) | |
| model_parameter = UnfoldSim.create_kelly_parameters_dict(UnfoldSim.KellyModel(drift_rate="drift_rate")); | |
| c = Drift_Component(simulate_component, 0:1/500:1.0, 1/500, KellyModel, model_parameter); | |
| drift_rates = [0.5, 0.8] | |
| design_single = UnfoldSim.SingleSubjectDesign(conditions = Dict(:drift_rate => drift_rates, :condition => [1])); | |
| events = UnfoldSim.generate_events(rng, design_single) | |
| for (i, evt) in enumerate(eachrow(events)) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/component.jl
Line 93 in a0f9253
| end | 
[JuliaFormatter] reported by reviewdog 🐶
Line 109 in a0f9253
| fs=500 | 
[JuliaFormatter] reported by reviewdog 🐶
Lines 123 to 127 in a0f9253
| Dict('S'=>UniformOnset(width=0,offset=80), | |
| 'C'=>DriftOnset(), | |
| 'R'=>UniformOnset(width=0,offset=120))) | |
| model_parameter = UnfoldSim.create_kelly_parameters_dict(UnfoldSim.KellyModel(drift_rate="drift_rate")); | |
| c = UnfoldSim.Drift_Component(simulate_component, 0:1/500:1.0, 1/500, KellyModel, model_parameter); | 
[JuliaFormatter] reported by reviewdog 🐶
Lines 129 to 130 in a0f9253
| design_single = UnfoldSim.SingleSubjectDesign(conditions = Dict(:drift_rate => [0.5, 0.8], :condition => [1])); | |
| design_seq = UnfoldSim.SequenceDesign(design_single,"SCR_"); | 
[JuliaFormatter] reported by reviewdog 🐶
Line 132 in a0f9253
| simulation = UnfoldSim.Simulation(design_rep, components, sequence_onset, UnfoldSim.NoNoise()) | 
[JuliaFormatter] reported by reviewdog 🐶
Lines 143 to 146 in a0f9253
| Dict('S'=>UniformOnset(width=0,offset=80), | |
| 'C'=>(DriftOnset(), UniformOnset(width=0, offset=140)), | |
| 'R'=>UniformOnset(width=0,offset=120))) | |
| simulation = UnfoldSim.Simulation(design_rep, components, sequence_onset, UnfoldSim.NoNoise()) | 
[JuliaFormatter] reported by reviewdog 🐶
| Δt = 1/fs; # time step | 
[JuliaFormatter] reported by reviewdog 🐶
| time_vec = 0:Δt:tEnd; # time base | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/sequentialSamplingModelSimulation.jl
Lines 10 to 11 in a0f9253
| km = KellyModel(event_onset=assert_event_onset, drift_rate=assert_drift_rate); | |
[JuliaFormatter] reported by reviewdog 🐶
| result_rt, result_trace = UnfoldSim.KellyModel_simulate_cpp(rng, KellyModel(boundary=boundary), time_vec, Δt) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 399.6903067274333, atol=1e-8) | 
[JuliaFormatter] reported by reviewdog 🐶
| result_sim_rt, result_sim_trace = UnfoldSim.SSM_Simulate(rng, KellyModel(), Δt, time_vec) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/sequentialSamplingModelSimulation.jl
Lines 32 to 35 in a0f9253
| model_parameter = UnfoldSim.create_kelly_parameters_dict(KellyModel(boundary=boundary)); | |
| c = UnfoldSim.Drift_Component(simulate_component, time_vec, Δt, KellyModel, model_parameter); | |
| design_single = UnfoldSim.SingleSubjectDesign(conditions = Dict(:drift_rate => [0.5, 0.8], :condition => [1])); | |
| design_seq = UnfoldSim.SequenceDesign(design_single,"SCR_"); | 
[JuliaFormatter] reported by reviewdog 🐶
| result_rts, result_traces = UnfoldSim.trace_sequential_sampling_model(rng, c, design_seq) | 
[JuliaFormatter] reported by reviewdog 🐶
| result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), KellyModel(), Δt, time_vec) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 399.6903067274333, atol=1e-8) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 223.00000000000003, atol=1e-8) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 397.0, atol=1e-8) | 
Co-authored-by: Benedikt Ehinger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
| Δt = 1/fs; # time step | 
[JuliaFormatter] reported by reviewdog 🐶
| time_vec = 0:Δt:tEnd; # time base | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/sequentialSamplingModelSimulation.jl
Lines 10 to 11 in ff43378
| km = KellyModel(event_onset=assert_event_onset, drift_rate=assert_drift_rate); | |
[JuliaFormatter] reported by reviewdog 🐶
| result_rt, result_trace = UnfoldSim.KellyModel_simulate_cpp(rng, KellyModel(boundary=boundary), time_vec, Δt) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 399.6903067274333, atol=1e-8) | 
[JuliaFormatter] reported by reviewdog 🐶
| result_sim_rt, result_sim_trace = UnfoldSim.SSM_Simulate(rng, KellyModel(), Δt, time_vec) | 
[JuliaFormatter] reported by reviewdog 🐶
UnfoldSim.jl/test/sequentialSamplingModelSimulation.jl
Lines 32 to 35 in ff43378
| model_parameter = UnfoldSim.create_kelly_parameters_dict(KellyModel(boundary=boundary)); | |
| c = UnfoldSim.Drift_Component(simulate_component, time_vec, Δt, KellyModel, model_parameter); | |
| design_single = UnfoldSim.SingleSubjectDesign(conditions = Dict(:drift_rate => [0.5, 0.8], :condition => [1])); | |
| design_seq = UnfoldSim.SequenceDesign(design_single,"SCR_"); | 
[JuliaFormatter] reported by reviewdog 🐶
| result_rts, result_traces = UnfoldSim.trace_sequential_sampling_model(rng, c, design_seq) | 
[JuliaFormatter] reported by reviewdog 🐶
| result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), KellyModel(), Δt, time_vec) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 399.6903067274333, atol=1e-8) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 223.00000000000003, atol=1e-8) | 
[JuliaFormatter] reported by reviewdog 🐶
| @test isapprox(result_rt, 397.0, atol=1e-8) | 
Formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely done! The code is already in good shape.
I think either define our own UnfoldSequentialSamplingModel or use the SamplingModels.SSM1D maybe? I like the later approach even better, maybe other models can then easily be reused from SequentialSamplingModels.jl as well
Co-authored-by: Benedikt Ehinger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very cool!! I will try to take this for a spin soon!
| ) | ||
| @debug "3D Array" | ||
| off = get_offset(component) - minoffset(simulation.components) | ||
| @views epoch_data[:, 1+off:length(component)+off, :] .+= | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| @views epoch_data[:, 1+off:length(component)+off, :] .+= | |
| @views epoch_data[:, (1+off):(length(component)+off), :] .+= | 
| 360.1329203034039 | ||
| ``` | ||
| """ | ||
| function calculate_response_times_for_ssm(rng, component::DriftComponent, design::UnfoldSim.SubselectDesign) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| function calculate_response_times_for_ssm(rng, component::DriftComponent, design::UnfoldSim.SubselectDesign) | |
| function calculate_response_times_for_ssm( | |
| rng, | |
| component::DriftComponent, | |
| design::UnfoldSim.SubselectDesign, | |
| ) | 
| # Returns | ||
| - `simulate_interonset_distances`: function call. | ||
| """ | ||
| UnfoldSim.simulate_interonset_distances(rng, onset::AbstractOnset, design::AbstractDesign, components::AbstractComponent) = UnfoldSim.simulate_interonset_distances(rng,onset,design) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| UnfoldSim.simulate_interonset_distances(rng, onset::AbstractOnset, design::AbstractDesign, components::AbstractComponent) = UnfoldSim.simulate_interonset_distances(rng,onset,design) | |
| UnfoldSim.simulate_interonset_distances( | |
| rng, | |
| onset::AbstractOnset, | |
| design::AbstractDesign, | |
| components::AbstractComponent, | |
| ) = UnfoldSim.simulate_interonset_distances(rng, onset, design) | 
| # Returns | ||
| - `Vector{Int}`: the generated onsets for the drift components in the SequenceDesign. | ||
| """ | ||
| function UnfoldSim.simulate_interonset_distances(rng, onset::DriftOnset, design::AbstractDesign, components::AbstractComponent) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| function UnfoldSim.simulate_interonset_distances(rng, onset::DriftOnset, design::AbstractDesign, components::AbstractComponent) | |
| function UnfoldSim.simulate_interonset_distances( | |
| rng, | |
| onset::DriftOnset, | |
| design::AbstractDesign, | |
| components::AbstractComponent, | |
| ) | 
| function UnfoldSim.simulate_interonset_distances(rng, onset::Tuple, design::AbstractDesign, components::AbstractComponent) | ||
| return Int.(round.(reduce(.+, simulate_interonset_distances.(deepcopy(rng), onset, Ref(design), Ref(components))))) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| function UnfoldSim.simulate_interonset_distances(rng, onset::Tuple, design::AbstractDesign, components::AbstractComponent) | |
| return Int.(round.(reduce(.+, simulate_interonset_distances.(deepcopy(rng), onset, Ref(design), Ref(components))))) | |
| function UnfoldSim.simulate_interonset_distances( | |
| rng, | |
| onset::Tuple, | |
| design::AbstractDesign, | |
| components::AbstractComponent, | |
| ) | |
| return Int.( | |
| round.( | |
| reduce( | |
| .+, | |
| simulate_interonset_distances.( | |
| deepcopy(rng), | |
| onset, | |
| Ref(design), | |
| Ref(components), | |
| ), | |
| ), | |
| ), | |
| ) | 
| # Returns | ||
| - `Vector{Float64}`: the generated onsets for the end of a sequence in the SequenceDesign. | ||
| """ | ||
| function UnfoldSim.simulate_interonset_distances(rng, onset::Char, design::AbstractDesign, components::AbstractComponent) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| function UnfoldSim.simulate_interonset_distances(rng, onset::Char, design::AbstractDesign, components::AbstractComponent) | |
| function UnfoldSim.simulate_interonset_distances( | |
| rng, | |
| onset::Char, | |
| design::AbstractDesign, | |
| components::AbstractComponent, | |
| ) | 
| onset_counter = Dict() | ||
| for k in keys(onset.onset) | ||
| sub_design = UnfoldSim.SubselectDesign(simulation.design, k) | ||
| onsets_for_k = simulate_interonset_distances(deepcopy(rng), onset.onset[k], sub_design, simulation.components[k][1]) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| onsets_for_k = simulate_interonset_distances(deepcopy(rng), onset.onset[k], sub_design, simulation.components[k][1]) | |
| onsets_for_k = simulate_interonset_distances( | |
| deepcopy(rng), | |
| onset.onset[k], | |
| sub_design, | |
| simulation.components[k][1], | |
| ) | 
| push!(final_onsets, onset_map[evt_k][onset_counter[evt_k]]) | ||
| onset_counter[evt_k] += 1 | ||
| end | ||
| final_onsets = vcat(final_onsets[end], final_onsets[1:end-1]) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| final_onsets = vcat(final_onsets[end], final_onsets[1:end-1]) | |
| final_onsets = vcat(final_onsets[end], final_onsets[1:(end-1)]) | 
| hey, I know you are official "out", but I'll come back to your offer at some point to still answer some questions ;-) Do you know why LBA needs vector of driftrates? That makes it a bit ugly, because I need to do: We definitely should try to catch that somehowedit | 
| Hey, no problem, you are always welcome to ask, but I may not answer so quickly. | 
| """ | ||
| function KellyModel_simulate_cpp(rng, model::KellyModel, time_vec, Δt) | ||
| evidence = zeros(length(time_vec)) | ||
| evidence[time_vec.>=rand(rng, model.event_onset_distribution)] .= 1 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| evidence[time_vec.>=rand(rng, model.event_onset_distribution)] .= 1 | |
| evidence[time_vec .>= rand(rng, model.event_onset_distribution)] .= 1 | 
| """ | ||
| function SSM_Simulate(rng, model::KellyModel, sfreq, max_length) | ||
| Δt = 1 / sfreq | ||
| time_vec = 0:Δt:max_length*Δt | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| time_vec = 0:Δt:max_length*Δt | |
| time_vec = 0:Δt:(max_length*Δt) | 
| end | ||
| evidence = evidence[1:max_length] | ||
| return rt, evidence | ||
| end No newline at end of file | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| end | |
| end | 
| ), | ||
| ) | ||
| # Deconvolution sucessfully removed the stimulus and response overlaps from our estimates, but it kept the drift-diffusion aspect nearly untouched. It is important to stress the "nearly", because depending on the `delay` parameters, this can potentially lead to problematic situation where it is unclear whether the drift activity should be assigned to S or R. In most realistic situations we found to be safe. | ||
| # Further note that the drift-diffusion amplitude can be reduced because it is split up between `S` and `R` events.` No newline at end of file | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| # Further note that the drift-diffusion amplitude can be reduced because it is split up between `S` and `R` events.` | |
| # Further note that the drift-diffusion amplitude can be reduced because it is split up between `S` and `R` events.` | 
New Features:
Important Changes:
On Top I added unittests and docstrings for all new features
For better usability I have created two HowTo in the documentation: