@@ -7,18 +7,27 @@ An object for the starting-time diffusion decision model.
77
88- `ν::T`: vector of drift rate weights for attribute one and two. ν ∈ ℝ.
99- `σ::T`: diffusion noise. σ ∈ ℝ⁺.
10- - `s::T`: initial latency bias (positive for attribute two, negative for attribute one)
11- - `z::T`: initial evidence. z ∈ [0,α].
1210- `η::T`: vector of variability in drift rate for attribute one and two. η ∈ ℝ⁺.
11+ - `s::T`: initial latency bias (positive for attribute two, negative for attribute one)
1312- `ρ::T`: correlation between drift rate for attributes. ρ ∈ [-1,1].
1413- `α::T`: evidence threshold. α ∈ ℝ⁺.
14+ - `z::T`: initial evidence. z ∈ [0,α].
1515- `τ::T`: non-decision time. τ ∈ [0, min_rt].
1616
1717# Constructors
1818
19- stDDM(ν, σ, s, z, η, ρ, α, τ)
20-
21- stDDM(;ν = [0.5,0.6],σ = 1,s = 0.50, z = 0.50, η = [1.0,1.0], ρ = 0.00, α = 1.0, τ = .300)
19+ stDDM(ν, σ, η, s, ρ, α, z, τ)
20+
21+ stDDM(;
22+ ν = [0.5, 0.6],
23+ σ = 1,
24+ s = 0.50,
25+ ρ = 0.0,
26+ η = fill(1.0, length(ν)),
27+ α = 1.0,
28+ z = 0.50,
29+ τ = 0.300
30+ )
2231
2332# Example
2433
@@ -27,15 +36,15 @@ using SequentialSamplingModels
2736
2837ν = [0.5, 0.6]
2938σ = 1
30- s = 0.50
31- z = 0.50
3239η = [1.0, 1.0]
3340ρ = 0.00
41+ s = 0.50
3442α = 1.0
43+ z = 0.50
3544τ = 0.300
3645
3746# Create stDDM model instance
38- dist = stDDM(;ν, σ, s, z, η, ρ, α, τ)
47+ dist = stDDM(; ν, σ, s, z, η, ρ, α, τ)
3948
4049choices,rts = rand(dist, 500)
4150```
@@ -56,36 +65,36 @@ Sullivan, N.J., Huettel, S.A. Healthful choices depend on the latency and rate o
5665mutable struct stDDM{T <: Real } <: AbstractstDDM
5766 ν:: Vector{T}
5867 σ:: T
59- s:: T
60- z:: T
6168 η:: Vector{T}
69+ s:: T
6270 ρ:: T
6371 α:: T
72+ z:: T
6473 τ:: T
6574end
6675
67- function stDDM(ν, σ, s, z, η, ρ, α, τ:: T ) where {T}
68- _, σ, s, z, _, ρ, α, τ = promote(ν[1 ], σ, s, z, η[1 ], ρ, α, τ)
76+ function stDDM(ν, σ, η, s, ρ, α, z , τ:: T ) where {T}
77+ _, σ, _, s, ρ, α, z, τ = promote(ν[1 ], σ, η[1 ], s, ρ, α, z , τ)
6978 ν = convert(Vector{T}, ν)
7079 η = convert(Vector{T}, η)
71- return stDDM(ν, σ, s, z, η, ρ, α, τ)
80+ return stDDM(ν, σ, η, s, ρ, α, z , τ)
7281end
7382
7483function stDDM(;
7584 ν = [0.5 , 0.6 ],
7685 σ = 1 ,
7786 s = 0.50 ,
78- z = 0.50 ,
79- η = fill(1.0 , length(ν)),
8087 ρ = 0.0 ,
88+ η = fill(1.0 , length(ν)),
8189 α = 1.0 ,
90+ z = 0.50 ,
8291 τ = 0.300
8392)
84- return stDDM(ν, σ, s, z, η, ρ, α, τ)
93+ return stDDM(ν, σ, η, s, ρ, α, z , τ)
8594end
8695
8796function params(d:: AbstractstDDM )
88- (d. ν, d. σ, d. s , d. z , d. η , d. ρ , d. α , d. τ)
97+ (d. ν, d. σ, d. η , d. s , d. ρ , d. α , d. z , d. τ)
8998end
9099
91100get_pdf_type(d:: AbstractstDDM ) = Approximate
0 commit comments