Wald Mixture Model

The Wald mixture model is a sequential sampling model for single choice decisions. It extends the Wald model by allowing the drift rate to vary randomly across trials.

Example

In this example, we will demonstrate how to use the Wald mixture model in a generic single choice decision task.

Load Packages

The first step is to load the required packages.

using SequentialSamplingModels
using SSMPlots
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 Rate

The parameter $\nu$ represents the evidence accumulation rate.

ν = 3.0
3.0

Drift Rate

The parameter $\nu$ represents the evidence accumulation rate.

ν = 3.0
3.0

Drift Rate Variability

The parameter $\sigma$ represents the standard deviation of the evidence accumulation rate across trials.

σ = 0.20
0.2

Threshold

The parameter $\alpha$ the amount of evidence required to make a decision.

α = 0.50
0.5

Non-Decision Time

Non-decision time is an additive constant representing encoding and motor response time.

τ = 0.130
0.13

Wald Constructor

Now that values have been asigned to the parameters, we will pass them to WaldMixture to generate the model object.

dist = WaldMixture(ν, σ, α, τ)
WaldMixture
┌───────────┬───────┐
│ Parameter │ Value │
├───────────┼───────┤
│ ν         │  3.00 │
│ η         │  0.20 │
│ α         │  0.50 │
│ τ         │  0.13 │
└───────────┴───────┘

Simulate Model

Now that the model is defined, we will generate $10,000$ choices and reaction times using rand.

rts = rand(dist, 1000)
1000-element Vector{Float64}:
 0.2985775398659861
 0.17056209415234508
 0.21388694034995456
 0.3436694210903711
 0.21823360160709887
 0.21917496349703433
 0.4758371809230722
 0.20036866651357083
 0.173209720589727
 0.21385464340675164
 ⋮
 0.7107341747898386
 0.16124506250720577
 0.2554216281785783
 0.22521218639371396
 0.19911919126131303
 0.17327926070615948
 0.40659294373568594
 0.2277291677905871
 0.2184825080497489

Compute PDF

Similarly, the log PDF for each observation can be computed as follows:

pdf.(dist, rts)
1000-element Vector{Float64}:
 2.8816315798862946
 4.195152339574874
 5.6915324908634375
 1.9285494846446496
 5.567375646950258
 5.538356015983713
 0.6495896157131353
 5.915474925611149
 4.553410034393033
 5.692386277601732
 ⋮
 0.12303574977492138
 2.5826530384542123
 4.22616352344941
 5.33873560287217
 5.918008814633779
 4.562161283220702
 1.1289434808223116
 5.250235818560784
 5.559768168263452

Compute Log PDF

Similarly, the log PDF for each observation can be computed as follows:

logpdf.(dist, rts)
1000-element Vector{Float64}:
  1.0583566545293834
  1.4339296538187805
  1.7389795424312404
  0.656768157991933
  1.7169237843723748
  1.7116977087034069
 -0.4314144759257178
  1.777571785941909
  1.5158764103677311
  1.739129541171966
  ⋮
 -2.0952803172632377
  0.9488171800638838
  1.4412946130617663
  1.6749888464472935
  1.7780000434385137
  1.5177964768586443
  0.12128222264099994
  1.6582729934158584
  1.7155564110376795

Plot Simulation

The code below overlays the PDF on reaction time histogram.

histogram(dist)
plot!(dist; t_range=range(.130, 1, length=100))

References

Steingroever, H., Wabersich, D., & Wagenmakers, E. J. (2021). Modeling across-trial variability in the Wald drift rate parameter. Behavior Research Methods, 53, 1060-1076.