Circular Drift Diffusion Model

The Circular Drift Diffusion Model (CDDM; Smith, 2016) is a sequential sampling model for continuous responding on a circular domain. The CDDM is often used to model visual working memory. In these visual working memory tasks, subjects are briefly presented with a variable number of squares of different colors. After the stimuli are removed, subjects are prompted to use a color wheel to judge the color of a randomly selected square. Currently, the model is restricted to a 2D disk, but future versions may support modeling diffusion processes in hyperspheres.

The figure below illustrates the evidence accumulation process of the CDDM. At the begining of the trial, the evidence accumulation process starts at the center of the circle. As time progresses, the state of the system moves towards the the decision threshold depicted by the circle. Each step is perturbed with some degree of randomness. Once the system reaches the decision threshold, a response based on the position on the circle is given.

Example

In this example, we will demonstrate how to use the CDDM in a generic two alternative forced choice task.

Load Packages

The first step is to load the required packages.

using LinearAlgebra
using SequentialSamplingModels
using Plots
using Random

Random.seed!(5874)
Random.TaskLocalRNG()

Create Model Object

In the code below, we will define parameters for the CDDM and create a model object to store the parameter values.

Drift Rates

The mean drift rates $\boldsymbol{\nu}$ control the speed with which information accumulates in the x and y direction.

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

The magnitude of the mean drift rate vector $||\boldsymbol{\nu}||$ is interpreted as the mean accumulation rate.

norm(ν)
7.433034373659253

The average direction of the accumulation process is given by $\mathrm{arctan}(\frac{\nu_2}{\nu_1})$:

atan(ν[2], ν[1])
0.7378150601204649

Drift Rate Standard Deviation

The standard deviation of the drift rate $\boldsymbol{\eta}$ is inteprpreted as variability in the evidence accumulation across trials.

η = [.50,.50]
2-element Vector{Float64}:
 0.5
 0.5

Threshold

Evidence starts at the center of a circle $(0,0)$ and terminates at a threshold defined by the circumference of the circle. The distance between the starting point and any point on the circumference is given by the radius $\alpha$:

α = 4.0
4.0

Diffusion

Intra-trial variability in the accumulation process is governed by parameter $\sigma$

σ = 1.0
1.0

Non-Decision Time

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

τ = 0.30
0.3

CDDM Constructor

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

dist = CDDM(ν, η, σ, α, τ)

Simulate Model

Now that the model is defined, we will generate $10,000$ choices and reaction times using rand. The simulated data is a 2D array in which the first column contains the observed angular responses and the second column contains the corresponding reaction times.

 data = rand(dist, 10_000)

Compute PDF

The PDF for each observation can be computed as follows:

pdf(dist, data)

Compute Log PDF

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

logpdf(dist, data)

Plot Simulation

The code below overlays the PDF on the marginal histograms for angle and reaction time.

histogram(dist)
plot!(dist)

References

Smith, P. L. (2016). Diffusion theory of decision making in continuous report. Psychological Review, 123(4), 425.

Smith, P. L., Garrett, P. M., & Zhou, J. (2023). Obtaining Stable Predicted Distributions of Response Times and Decision Outcomes for the Circular Diffusion Model. Computational Brain & Behavior, 1-13.