SequentialSamplingModels.SequentialSamplingModels
— ModuleSequentialSamplingModels.jl
A collection of sequential sampling models based on the Distributions.jl API.
Currently Supported models
LBA
: Linear Ballistic AccumulatorLNR
: Lognormal Race ModelWald
: a shifted Wald represented a single boundary diffusion processWaldMixture
: a shifted Wald represented a single boundary diffusion process with across-trial variability in the drift rateaDDM
: a drift diffusion model in which the accumulation process is determined by the
utility of a visually attended option
SequentialSamplingModels.DiffusionRace
— TypeDiffusionRace(;ν, k, A, θ)
An object for the racing diffusion model.
Fields
ν
: a vector of drift ratesk
: k = b - A where b is the decision threshold, and A is the maximum starting pointA
: the maximum starting point diffusion process, sampled from Uniform distributionθ
: a encoding-motor time offset
Example
using SequentialSamplingModels
dist = DiffusionRace(;ν=[1,2], k=.3, A=.7, θ=.2)
data = rand(dist, 10)
like = pdf.(dist, data)
loglike = logpdf.(dist, data)
References
Tillman, G., Van Zandt, T., & Logan, G. D. (2020). Sequential sampling models without random between-trial variability: The racing diffusion model of speeded decision making. Psychonomic Bulletin & Review, 27, 911-936.
SequentialSamplingModels.LBA
— TypeLBA(;τ, A, k, ν, σ=1.0)
A model object for the linear ballistic accumulator.
Fields
ν
: a vector of drift ratesA
: max start pointk
: A + k = b, where b is the decision thresholdσ=1
: drift rate standard deviationτ
: a encoding-response offset
Example
using SequentialSamplingModels
dist = LBA(ν=[3.0,2.0], A = .8, k = .2, τ = .3)
choice,rt = rand(dist, 10)
like = pdf.(dist, choice, rt)
loglike = logpdf.(dist, choice, rt)
References
Brown, S. D., & Heathcote, A. (2008). The simplest complete model of choice response time: Linear ballistic accumulation. Cognitive psychology, 57(3), 153-178.
SequentialSamplingModels.LNR
— TypeLNR(;μ, σ, ϕ)
A lognormal race model object
Fields
μ
: a vector of means in log-spaceσ
: a standard deviation parameter in log-spaceϕ
: a encoding-response offset
Example
using SequentialSamplingModels
dist = LNR(μ=[-2,-3], σ=1.0, ϕ=.3)
data = rand(dist, 10)
like = pdf.(dist, data)
loglike = logpdf.(dist, data)
References
Rouder, J. N., Province, J. M., Morey, R. D., Gomez, P., & Heathcote, A. (2015). The lognormal race: A cognitive-process model of choice and latency with desirable psychometric properties. Psychometrika, 80(2), 491-513.
SequentialSamplingModels.Wald
— TypeWald Constructor
υ
: drift rateα
: decision thresholdθ
: a encoding-response offset
Usage
using SequentialSamplingModels
dist = Wald(υ=3.0, α=.5, θ=.130)
rt = rand(dist, 10)
like = pdf.(dist, rt)
loglike = logpdf.(dist, rt)
SequentialSamplingModels.WaldA
— TypeWaldA(;ν, k, A, θ)
Constructor for Wald distribution
Fields
ν
: drift ratek
: k = b - A where b is the decision threshold, and A is the maximum starting pointA
: the maximum starting point diffusion process, sampled from Uniform distributionθ
: a encoding-motor time offset
Usage
using SequentialSamplingModels
dist = WaldA(ν=.5, σ=1.0, ϕ=.3)
data = rand(dist, 10)
like = pdf.(dist, data)
loglike = logpdf.(dist, data)
References
Tillman, G., Van Zandt, T., & Logan, G. D. (2020). Sequential sampling models without random between-trial variability: The racing diffusion model of speeded decision making. Psychonomic Bulletin & Review, 27, 911-936.
SequentialSamplingModels.WaldMixture
— TypeWaldMixture Constructor
υ
: drift rateσ
: standard deviation of drift rateα
: decision thresholdθ
: a encoding-response offset
Usage
using SequentialSamplingModels
dist = WaldMixture(υ=3.0, σ=.2, α=.5, θ=.130)
rt = rand(dist, 10)
like = pdf.(dist, rt)
loglike = logpdf.(dist, rt)
References
Steingroever, H., Wabersich, D., & Wagenmakers, E. J. (2020). Modeling across-trial variability in the Wald drift rate parameter. Behavior Research Methods, 1-17.
SequentialSamplingModels.aDDM
— MethodaDDM(;ν1=5.0, ν2=4.0, α=1.0, z=α*.5, θ=.3, σ=.02, Δ=.0004)
Constructor for attentional diffusion model object.
Keywords
ν1=5.0
: relative decision value for alternative 1ν2=4.0
: relative decision value for alternative 2α=1.0
: evidence thresholdz=0.0
: initial evidenceθ=.3
: bias towards attended alternative (lower indicates more bias)σ=.02
: standard deviation of noise in evidence accumulationΔ=.0004
: constant of evidence accumulation speed (evidence per ms)
References
Krajbich, I., Armel, C., & Rangel, A. (2010). Visual fixations and the computation and comparison of value in simple choice. Nature neuroscience, 13(10), 1292-1298.
SequentialSamplingModels.maaDDM
— MethodmaaDDM(; ν₁₁ = 4.0,
ν₁₂ = 5.0,
ν₂₁ = 5.0,
ν₂₂ = 4.0,
α = 1.0,
z = 0.0,
θ = .3,
ϕ = .50,
ω = .70,
σ = .02,
Δ = .0004)
Constructor for multialternative attentional diffusion model object.
In this version of the model, the non-attended attribute of the non-attended alternative is doubly discounted. For example, the mean drift rate for the attribute 1 of alternative 1 is given by:
Δ * (ω * (ν₁₁ - θ * ν₂₁) + (1 - ω) * ϕ * (ν₁₂ - θ * ν₂₂))
Keywords
ν₁₁=5.0
: relative decision value for alternative 1, attribute 1ν₁₂=4.0
: relative decision value for alternative 1, attribute 2ν₂₁=5.0
: relative decision value for alternative 2, attribute 1ν₂₂=4.0
: relative decision value for alternative 2, attribute 2α=1.0
: evidence thresholdz=0.0
: initial evidenceθ=.3
: bias away from unattended alternative (lower indicates more bias)ϕ=.50
: bias away from unattended attributeω=.70
: attribute weightσ=.02
: standard deviation of noise in evidence accumulationΔ=.0004
: constant of evidence accumulation speed (evidence per ms)
References
Yang, X., & Krajbich, I. (2023). A dynamic computational model of gaze and choice in multi-attribute decisions. Psychological Review, 130(1), 52.
Base.rand
— Methodrand(dist::aDDM, fixation, args...; kwargs...)
Generate a single simulated trial from the attention diffusion model.
Arguments
dist
: an attentional diffusion model objectfixation
: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2args...
: optional positional arguments for thefixation
function
Keywords
kwargs...
: optional keyword arguments for thefixation
function
Base.rand
— Methodrand(dist::aDDM, n_sim::Int, fixation, args...; kwargs...)
Generate n_sim
simulated trials from the attention diffusion model.
Arguments
dist
: an attentional diffusion model objectn_sim::Int
: the number of simulated trialsfixation
: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2args...
: optional positional arguments for thefixation
function
Keywords
kwargs...
: optional keyword arguments for thefixation
function
SequentialSamplingModels.update
— Methodupdate(dist::aDDM, location)
Returns the change evidence for a single iteration.
Arguments
dist::aDDM
: a model object for the attentional drift diffusion modellocation
: an index for fixation location
SequentialSamplingModels.update
— Methodupdate(dist::maaDDM, location)
Returns the change evidence for a single iteration.
Arguments
dist::maaDDM
: a model object for the multiattribute attentional drift diffusion modellocation
: an index for fixation location