Attentional Drift Diffusion Model

The attentional drift diffusion model (ADDM; Krajbich, Armel, & Rangel, 2010) describes how attentional processes drive drive decision making. In the ADDM, preference for the currently attended option accrues faster than preference for non-attended options. As with other sequential sampling models, the first option to hit a decision threshold determines the resulting choice and reaction time.

Example

In this example, we will develope a ADDM for binary choice and generate its predictions. Unlike many other sequential sampling models, it is necessary to specify the attentional process, or supply fixation patterns from eye tracking data.

Load Packages

The first step is to load the required packages.

using SequentialSamplingModels
using StatsBase
using Plots

Random.seed!(5487)
Random.TaskLocalRNG()

Define Transition Type

To represent the transition of attention from one option to the other, we will definite a Transition type and constructor. The fields of the Transition type are:

  1. state: an index for the current state
  2. n: the number of states
  3. mat: an $n\times n$ transition matrix

The constructor accepts a transition matrix, extracts the number of states, and initializes the first state randomly with equal probability.

mutable struct Transition
    state::Int
    n::Int
    mat::Array{Float64,2}
 end

function Transition(mat)
    n = size(mat,1)
    state = rand(1:n)
    return Transition(state, n, mat)
 end
Main.Transition

Define Transition Matrix

The transition matrix is defined below in the constructor for Transition. As shown in the table below, the model's attention can be in one of three states: option 1, option 2, or non-option, which is any area except the two options.

option 1option 2non-option
option 10.980.0150.005
option 20.0150.980.005
non-option0.450.450.10

The transition matrix above embodies the following assumptions:

  1. Once the model attends to an option, it dwells on the option for some time.
  2. There is not a bias for one option over the other.
  3. The chance of fixating on a non-option is small, and such fixations are brief when they do occur.
  4. Transitions are Markovian in that they only depend on the previous state.
tmat = Transition([.98 .015 .005;
                    .015 .98 .005;
                    .45 .45 .1])
Main.Transition(2, 3, [0.98 0.015 0.005; 0.015 0.98 0.005; 0.45 0.45 0.1])

Attend Function

The function below generates the next attention location based on the previous location.

 function fixate(transition)
     (;mat,n,state) = transition
     w = @view mat[state,:]
     next_state = sample(1:n, Weights(w))
     transition.state = next_state
     return next_state
 end
fixate (generic function with 1 method)

Create Model Object

The code snippets assign values to parameters of the ADDM and create a model object.

Drift Rate Components

The ADDM has two drift rates components corresponding to the utlity of each option. To form the drift rate, each component is weighted by non-attention bias and then a difference is computed.

ν = [6.0,5.0]
2-element Vector{Float64}:
 6.0
 5.0

Threshold

The threshold hold represents the amount of evidence required to make a decision. This parameter is typically fixed at $\alpha = 1$.

α = 1.0
1.0

Starting Point

The starting point of the evidence accumulation process is denoted $z$ and is typically fixed to $0$.

z = 0.0
0.0

Non-Attend Bias

The non-attend bias parameter $\theta$ determines how much the non-attended option contributes to the evidence accumulation process. In the standard DDM, $\theta=1$.

θ = 0.30
0.3

Diffusion Noise

Diffusion noise, $\sigma$ represents intra-trial noise during the evidence accumulation process.

σ = 0.02
0.02

Drift Rate Scalar

The drift rate scalar controls how quickly evidence accumulates for each option.

Δ = 0.0004
0.0004

Model Object

Finally, we pass the parameters to the aDDM constructor to initialize the model.

 model = aDDM(; ν, α, z, θ, σ, Δ)
aDDM
┌───────────┬────────────┐
│ Parameter │ Value      │
├───────────┼────────────┤
│ ν         │ [6.0, 5.0] │
│ σ         │  0.02      │
│ Δ         │  0.00      │
│ θ         │  0.30      │
│ α         │  1.00      │
│ z         │  0.00      │
│ τ         │  0.00      │
└───────────┴────────────┘

Simulate Model

Now that the model is defined, we will generate $10,000$ choices and reaction times using rand. The rand function accepts the model object, the number of simulated trials, the fixate function, and the transition matrix object.

 choices,rts = rand(model, 10_000, tmat; fixate)
(choice = [1, 1, 2, 1, 1, 1, 1, 1, 1, 1  …  2, 2, 1, 1, 1, 2, 1, 2, 1, 1], rt = [2.498999999999836, 1.0459999999999956, 3.030999999999777, 2.2309999999998653, 1.0449999999999957, 0.6940000000000005, 1.2179999999999767, 1.9369999999998975, 0.6510000000000005, 0.9230000000000007  …  0.6590000000000005, 2.0109999999998895, 1.559999999999939, 0.8480000000000006, 4.239999999999751, 5.55500000000019, 0.2420000000000002, 1.5009999999999455, 3.015999999999779, 1.7569999999999173])

Plot Simulation

Finally, we can generate histograms of the reaction times for each decision option.

histogram(model; model_args=(;tmat), model_kwargs=(;fixate))
plot!(model; model_args=(;tmat), model_kwargs=(;fixate), t_range=range(0.0, 5, length=100), xlims=(0,5))
Example block output

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.