SequentialSamplingModels.SequentialSamplingModelsModule

SequentialSamplingModels.jl

A collection of sequential sampling models based on the Distributions.jl API.

Currently Supported models

  • LBA: Linear Ballistic Accumulator
  • LNR: Lognormal Race Model
  • Wald: a shifted Wald represented a single boundary diffusion process
  • WaldMixture: a shifted Wald represented a single boundary diffusion process with across-trial variability in the drift rate
  • aDDM: a drift diffusion model in which the accumulation process is determined by the

utility of a visually attended option

SequentialSamplingModels.DiffusionRaceType
DiffusionRace(;ν, k, A, θ)

An object for the racing diffusion model.

Fields

  • ν: a vector of drift rates
  • k: k = b - A where b is the decision threshold, and A is the maximum starting point
  • A: 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.LBAType
LBA(;τ, A, k, ν, σ=1.0)

A model object for the linear ballistic accumulator.

Fields

  • ν: a vector of drift rates
  • A: max start point
  • k: 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.LNRType
LNR(;μ, σ, ϕ)

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.WaldType

Wald 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.WaldAType
WaldA(;ν, k, A, θ)

Constructor for Wald distribution

Fields

  • ν: drift rate
  • k: k = b - A where b is the decision threshold, and A is the maximum starting point
  • A: 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.WaldMixtureType

WaldMixture 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.aDDMMethod
aDDM(;ν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 threshold
  • z=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.maaDDMMethod
maaDDM(; ν₁₁ = 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 threshold
  • z=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.randMethod
rand(dist::aDDM, fixation, args...; kwargs...)

Generate a single simulated trial from the attention diffusion model.

Arguments

  • dist: an attentional diffusion model object
  • fixation: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2
  • args...: optional positional arguments for the fixation function

Keywords

  • kwargs...: optional keyword arguments for the fixation function
Base.randMethod
rand(dist::aDDM, n_sim::Int, fixation, args...; kwargs...)

Generate n_sim simulated trials from the attention diffusion model.

Arguments

  • dist: an attentional diffusion model object
  • n_sim::Int: the number of simulated trials
  • fixation: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2
  • args...: optional positional arguments for the fixation function

Keywords

  • kwargs...: optional keyword arguments for the fixation function
SequentialSamplingModels.updateMethod
update(dist::aDDM, location)

Returns the change evidence for a single iteration.

Arguments

  • dist::aDDM: a model object for the attentional drift diffusion model
  • location: an index for fixation location
SequentialSamplingModels.updateMethod
update(dist::maaDDM, location)

Returns the change evidence for a single iteration.

Arguments

  • dist::maaDDM: a model object for the multiattribute attentional drift diffusion model
  • location: an index for fixation location