Leaky Competing Accumulator
The Leaky Competing Accumulator (LCA; Usher & McClelland, 2001) is a sequential sampling model in which evidence for options races independently. The LBA makes an additional simplification that evidence accumulates in a linear and ballistic fashion, meaning there is no intra-trial noise. Instead, evidence accumulates deterministically and linearly until it hits the threshold.
Example
In this example, we will demonstrate how to use the LBA in a generic two alternative forced choice task.
Load Packages
The first step is to load the required packages.
using SequentialSamplingModels
using Plots
using Random
Random.seed!(8741)
Random.TaskLocalRNG()
Create Model Object
In the code below, we will define parameters for the LBA and create a model object to store the parameter values.
Drift Rates
The drift rates control the speed with which information accumulates. Typically, there is one drift rate per option.
ν = [2.5,2.0]
2-element Vector{Float64}:
2.5
2.0
Threshold
The threshold $\alpha$ represents the amount of evidence required to make a decision.
α = 1.5
1.5
Lateral Inhibition
The parameter $\beta$ inhibits evidence of competing options proportionally to their evidence value.
β = 0.20
0.2
Leak Rate
The parameter $\lambda$ controls the rate with which evidence decays or "leaks".
λ = 0.10
0.1
Diffusion Noise
Diffusion noise is the amount of within trial noise in the evidence accumulation process.
σ = 1.0
1.0
Time Step
The time step parameter $\Delta t$ is the precision of the discrete time approxmation.
Δt = .001
0.001
Non-Decision Time
Non-decision time is an additive constant representing encoding and motor response time.
τ = 0.30
0.3
LCA Constructor
Now that values have been asigned to the parameters, we will pass them to LCA
to generate the model object.
dist = LCA(; ν, α, β, λ, τ, σ, Δt)
LCA
┌───────────┬────────────┐
│ Parameter │ Value │
├───────────┼────────────┤
│ ν │ [2.5, 2.0] │
│ α │ 1.50 │
│ β │ 0.20 │
│ λ │ 0.10 │
│ τ │ 0.30 │
│ σ │ 1.00 │
│ Δt │ 0.00 │
└───────────┴────────────┘
Simulate Model
Now that the model is defined, we will generate $10,000$ choices and reaction times using rand
.
choices,rts = rand(dist, 10_000)
(choices = [1, 2, 1, 2, 1, 2, 1, 2, 1, 1 … 1, 2, 1, 2, 1, 1, 2, 2, 1, 2], rts = [0.7440000000000003, 0.5470000000000002, 0.4920000000000001, 1.0710000000000006, 0.9610000000000005, 1.1610000000000007, 1.0110000000000006, 0.6840000000000003, 0.9360000000000004, 0.4860000000000001 … 0.7760000000000004, 0.6660000000000003, 0.7850000000000004, 0.6650000000000003, 0.9400000000000004, 0.8100000000000003, 1.1680000000000006, 0.5110000000000001, 0.8130000000000004, 0.8290000000000004])
Plot Simulation
The code below plots a histogram for each option.
histogram(dist)
References
Usher, M., & McClelland, J. L. (2001). The time course of perceptual choice: The leaky, competing accumulator model. Psychological Review, 108 3, 550–592. https://doi.org/10.1037/0033-295X.108.3.550