@@ -6,11 +6,11 @@ An object for the attentional diffusion model.
66# Parameters
77
88- `ν::Vector{T}`: relative decision values (i.e., drift rates). ν ∈ ℝⁿ.
9- - `σ::T`: standard deviation of noise in evidence accumulation. σ ∈ ℝ.
10- - `Δ::T`: constant of evidence accumulation speed (evidence per ms). Δ ∈ ℝ.
11- - `α::T`: evidence threshold. α ∈ ℝ.
12- - `z::T`: initial evidence. z ∈ [0 , α]
13- - `θ::T`: bias towards attended alternative (lower indicates more bias)
9+ - `σ::T`: standard deviation of noise in evidence accumulation. σ ∈ ℝ⁺ .
10+ - `Δ::T`: constant of evidence accumulation speed (evidence per ms). Δ ∈ ℝ⁺ .
11+ - `α::T`: evidence threshold. α ∈ ℝ⁺ .
12+ - `z::T`: initial evidence. z ∈ [-α , α]
13+ - `θ::T`: bias towards attended alternative (lower indicates more bias) Δ ∈ ℝ⁺
1414- `τ::T`: non-decision time. τ ∈ [0, min_rt]
1515
1616# Constructors
@@ -71,6 +71,16 @@ struct aDDM{T <: Real} <: AbstractaDDM
7171 α:: T
7272 z:: T
7373 τ:: T
74+
75+ function aDDM (ν:: Vector{T} , σ:: T , Δ:: T , θ:: T , α:: T , z:: T , τ:: T ) where {T <: Real }
76+ @argcheck σ ≥ 0
77+ @argcheck Δ ≥ 0
78+ @argcheck θ ≥ 0
79+ @argcheck α ≥ 0
80+ @argcheck abs (z) ≤ α
81+ @argcheck τ ≥ 0
82+ return new {T} (ν, σ, Δ, θ, α, z, τ)
83+ end
7484end
7585
7686function aDDM (ν, σ, Δ, θ, α, z, τ)
@@ -286,10 +296,8 @@ function increment(rng::AbstractRNG, dist::aDDM, location)
286296 # option 2
287297 elseif location == 2
288298 return - Δ * (ν[2 ] - θ * ν[1 ]) + noise (rng, σ)
289- else
290- return noise (rng, σ)
291299 end
292- return - 100.0
300+ return noise (rng, σ)
293301end
294302
295303noise (rng, σ) = rand (rng, Normal (0 , σ))
0 commit comments