-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature sequential sampling models #139
base: fix#124
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>
data_epochs, | ||
); | ||
results = coeftable(m) | ||
plot_erp(results; mapping = (; color = :eventname)) |
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 🐶
plot_erp(results; mapping = (; color = :eventname)) | |
plot_erp(results; mapping = (; color = :eventname)) |
data, | ||
); | ||
results = coeftable(m) | ||
plot_erp(results; mapping = (; color = :eventname)) |
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 🐶
plot_erp(results; mapping = (; color = :eventname)) | |
plot_erp(results; mapping = (; color = :eventname)) |
``` | ||
""" | ||
function SSM_Simulate(rng, model::KellyModel, sfreq, max_length) | ||
Δt = 1/sfreq |
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 🐶
Δt = 1/sfreq | |
Δt = 1 / sfreq |
evidence = evidence[1:max_length] | ||
end | ||
return rt, evidence | ||
end |
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 |
# Test UnfoldSim.simulate_component(rng, c::DriftComponent, design::AbstractDesign) | ||
boundary = 1.0 | ||
model_parameter = Dict(:boundary => boundary); | ||
c = DriftComponent(500, 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) |
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 🐶
# Test UnfoldSim.simulate_component(rng, c::DriftComponent, design::AbstractDesign) | |
boundary = 1.0 | |
model_parameter = Dict(:boundary => boundary); | |
c = DriftComponent(500, 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) | |
# Test UnfoldSim.simulate_component(rng, c::DriftComponent, design::AbstractDesign) | |
boundary = 1.0 | |
model_parameter = Dict(:boundary => boundary) | |
c = DriftComponent(500, 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) |
model_parameter = Dict(:boundary => boundary); | ||
c = UnfoldSim.DriftComponent( | ||
max_length, | ||
fs, | ||
KellyModel, | ||
model_parameter, | ||
) |
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 🐶
model_parameter = Dict(:boundary => boundary); | |
c = UnfoldSim.DriftComponent( | |
max_length, | |
fs, | |
KellyModel, | |
model_parameter, | |
) | |
model_parameter = Dict(:boundary => boundary) | |
c = UnfoldSim.DriftComponent(max_length, fs, KellyModel, model_parameter) |
) | ||
design_seq = UnfoldSim.SequenceDesign(design_single, "SCR_") | ||
|
||
result_rts, result_traces = UnfoldSim.trace_sequential_sampling_model(rng, c, design_seq) |
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 🐶
result_rts, result_traces = UnfoldSim.trace_sequential_sampling_model(rng, c, design_seq) | |
result_rts, result_traces = | |
UnfoldSim.trace_sequential_sampling_model(rng, c, design_seq) |
end | ||
|
||
@testset "SSM_Simulate" begin | ||
result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), KellyModel(), fs, max_length) |
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 🐶
result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), KellyModel(), fs, max_length) | |
result_rt, result_trace = | |
UnfoldSim.SSM_Simulate(deepcopy(rng), KellyModel(), fs, max_length) |
@test any(result_trace .== 0) | ||
@test any(result_trace .>= boundary) | ||
|
||
result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), DDM(), fs, max_length) |
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 🐶
result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), DDM(), fs, max_length) | |
result_rt, result_trace = | |
UnfoldSim.SSM_Simulate(deepcopy(rng), DDM(), fs, max_length) |
@test isapprox(result_rt, 223.00000000000003, atol = 1e-8) | ||
@test any(result_trace .== 0) | ||
|
||
result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), LBA(), fs, max_length) |
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 🐶
result_rt, result_trace = UnfoldSim.SSM_Simulate(deepcopy(rng), LBA(), fs, max_length) | |
result_rt, result_trace = | |
UnfoldSim.SSM_Simulate(deepcopy(rng), LBA(), fs, max_length) |
return new(drift_rate, event_onset, sensor_encoding_delay, accumulative_level_noise, boundary, motor_onset, | ||
motor_delay, post_accumulation_duration, post_accumulation_duration_variability, | ||
ramp_down_duration) |
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 🐶
return new(drift_rate, event_onset, sensor_encoding_delay, accumulative_level_noise, boundary, motor_onset, | |
motor_delay, post_accumulation_duration, post_accumulation_duration_variability, | |
ramp_down_duration) | |
return new( | |
drift_rate, | |
event_onset, | |
sensor_encoding_delay, | |
accumulative_level_noise, | |
boundary, | |
motor_onset, | |
motor_delay, | |
post_accumulation_duration, | |
post_accumulation_duration_variability, | |
ramp_down_duration, | |
) |
rt = time_vec[dti] + model.motor_onset + (rand(rng) - 0.5) * model.motor_delay | ||
|
||
# now make the CPP peak and go down linearly after a certain amount of post-dec accum time for this trial: | ||
post_acc_duration = model.post_accumulation_duration .+ model.post_accumulation_duration_variability .* rand(rng); |
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 🐶
post_acc_duration = model.post_accumulation_duration .+ model.post_accumulation_duration_variability .* rand(rng); | |
post_acc_duration = | |
model.post_accumulation_duration .+ | |
model.post_accumulation_duration_variability .* rand(rng) |
tmp = cum_evidence[acc_stop_index] .- (1:(nT-acc_stop_index)) .*cum_evidence[acc_stop_index] .* (Δt ./ model.ramp_down_duration) | ||
cum_evidence[(acc_stop_index+1):end] .= max.(Ref(0), tmp); |
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 🐶
tmp = cum_evidence[acc_stop_index] .- (1:(nT-acc_stop_index)) .*cum_evidence[acc_stop_index] .* (Δt ./ model.ramp_down_duration) | |
cum_evidence[(acc_stop_index+1):end] .= max.(Ref(0), tmp); | |
tmp = | |
cum_evidence[acc_stop_index] .- | |
(1:(nT-acc_stop_index)) .* cum_evidence[acc_stop_index] .* | |
(Δt ./ model.ramp_down_duration) | |
cum_evidence[(acc_stop_index+1):end] .= max.(Ref(0), tmp) |
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: