Skip to content

Commit

Permalink
fix wald simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed Jul 19, 2023
1 parent 01934f6 commit 1fe2816
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SequentialSamplingModels"
uuid = "0e71a2a6-2b30-4447-8742-d083a85e82d1"
authors = ["itsdfish"]
version = "0.5.2"
version = "0.5.3"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
2 changes: 1 addition & 1 deletion src/RDM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function simulate(model::RDM; Δt=.001)
end

function increment!(model::RDM, x, ϵ, ν, Δt)
ϵ .= rand(Normal(0.0, 0.10), length(ν))
ϵ .= rand(Normal(0.0, 1.0), length(ν))
x .+= ν * Δt + ϵ * (Δt)
return nothing
end
2 changes: 1 addition & 1 deletion src/Wald.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function simulate(model::Wald; Δt=.001)
time_steps = [t]
while x .< α
t += Δt
x += ν * Δt + rand(Normal(0.0, 0.10)) * (Δt)
x += ν * Δt + rand(Normal(0.0, 1.0)) * (Δt)
push!(evidence, x)
push!(time_steps, t)
end
Expand Down
2 changes: 1 addition & 1 deletion src/wald_mixture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function simulate(model::WaldMixture; Δt=.001)
ν′ = rand(truncated(Normal(ν, η), 0, Inf))
while x .< α
t += Δt
x += ν′ * Δt + rand(Normal(0.0, 0.10)) * (Δt)
x += ν′ * Δt + rand(Normal(0.0, 1.0)) * (Δt)
push!(evidence, x)
push!(time_steps, t)
end
Expand Down
2 changes: 1 addition & 1 deletion test/wald_mixture_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@

@test time_steps[1] 0
@test length(time_steps) == length(evidence)
@test evidence[end] α atol = .005
@test evidence[end] α atol = .02
end
end
2 changes: 1 addition & 1 deletion test/wald_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@

@test time_steps[1] 0
@test length(time_steps) == length(evidence)
@test evidence[end] α atol = .005
@test evidence[end] α atol = .02
end
end

0 comments on commit 1fe2816

Please sign in to comment.