The Linear Ballistic Accumulator (LBA; Brown & Heathcote, 2008) 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.
In this example, we will demonstrate how to use the LBA in a generic two alternative forced choice task.
using SequentialSamplingModels
using Plots
using Random
The first step is to load the required packages.
using SequentialSamplingModels
using Plots
using Random
Random.seed!(8741)
In the code below, we will define parameters for the LBA and create a model object to store the parameter values.
The drift rates control the speed with which evidence accumulates for each option. In the standard LBA, drift rates vary across trials according to a normal distribution with mean
ν = [2.75,1.75]
The standard deviation of the drift rate distribution is given by
σ = [1.0,1.0]
The starting point of each accumulator is sampled uniformly between
A = 0.80
Evidence accumulates until accumulator reaches a threshold
k = 0.50
Non-decision time is an additive constant representing encoding and motor response time.
τ = 0.30
Now that values have been asigned to the parameters, we will pass them to LBA
to generate the model object.
dist = LBA(; ν, A, k, τ)
Now that the model is defined, we will generate rand
.
choices,rts = rand(dist, 10_000)
The PDF for each observation can be computed as follows:
pdf.(dist, choices, rts)
Similarly, the log PDF for each observation can be computed as follows:
logpdf.(dist, choices, rts)
The choice probability cdf
.
cdf(dist, 1)
To compute the joint probability of choosing
The code below overlays the PDF on reaction time histograms for each option.
histogram(dist)
plot!(dist; t_range=range(.3,2.5, length=100), xlims=(0, 2.5))
Brown, S. D., & Heathcote, A. (2008). The simplest complete model of choice response time: Linear ballistic accumulation. Cognitive psychology, 57(3), 153-178.