Leaky Competing Accumulator
The Leaky Competing Accumulator (LCA; Usher & McClelland, 2001) is a sequential sampling model in which evidence for options races independently. The LCA is similar to the Linear Ballistic Accumulator (LBA), but additionally assumes an intra-trial noise and leakage (in contrast, the LBA assumes that evidence accumulates in a ballistic fashion, i.e., linearly and deterministically until it hits the threshold).
Example
In this example, we will demonstrate how to use the LCA 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
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(; ν, α, β, λ, τ, σ)
LCA
┌───────────┬────────────┐
│ Parameter │ Value │
├───────────┼────────────┤
│ ν │ [2.5, 2.0] │
│ σ │ 1.00 │
│ β │ 0.20 │
│ λ │ 0.10 │
│ α │ 1.50 │
│ τ │ 0.30 │
└───────────┴────────────┘
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)
(choice = [1, 2, 1, 2, 1, 2, 1, 2, 1, 1 … 1, 2, 1, 2, 1, 1, 2, 2, 1, 2], rt = [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])
In the code block above, rand
has a keyword argument Δt
which controls the precision of the discrete approximation. The default value is Δt = .001
.
Compute Choice Probability
The choice probability $\Pr(C=c)$ is computed by passing the model and choice index to cdf
along with a large value for time as the second argument.
cdf(dist, 1, Inf)
0.592
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