[Problem Set 2 Quantitative models of behavior] Problem 3: The drift diffusion model of decision-making

Link of the iPython notebook for the code

AT2 – Neuromodeling: Problem set #2 QUANTITATIVE MODELS OF BEHAVIOR

PROBLEM 3: The drift diffusion model of decision-making.

We consider a two-alternative forced choice task (2AFC-task): the subject (e.g. a monkey) sees a cluster of moving dots (in many directions) on a screen and is to choose (whenever he/she/it wants) whether they are moving upwards or downwards.

In the drift-diffusion-model, the subject is assumed to compare two firing rates:

  • one firing rate of an upward-motion sensitive neuron, denoted by mA
  • and another one from a downward-motion sensitive neuron, denoted by mB

Then, the subjects integrates the difference as follows:

x˙=mAmB+ση(t)

where η(t)𝒩(0,1) is a Gaussian white noise.

For a given threshold μ:

  • if xμ then the subject chooses A
  • else if xμ then the subject chooses B

We have the following discrete approximation of the drift-diffusion-model:

x(t+t)=x(t)+(mAmB)t+ση(t)t

1. Reaction times

Let mA1,mB0.95,σ0.5,x(0)0, and t0.1ms.

Let us run the drift-diffusion-model ten times with the above parameters, with resort to the Euler method:

Figure 4.1.
Figure 3.1. - Ten runs of the drift-diffusion-model, with mA1,mB0.95,σ0.5,x(0)0

Now, after running the model N times and storing the outcome and the time of threshold crossing (denoted by ti) for each run: let us plot the distribution of reaction times for outcome A and B, given that the reaction time is given by:

RTi=100+ti
  • For N1000:

    Figure 1.1.
    Figure 1.1. - Distribution of reaction times for outcome A and B after running the model N=1000 times
  • For N10000:

    Figure 1.2.
    Figure 1.2. - Distribution of reaction times for outcome A and B after running the model N=10000 times

2. Probability of outcome A

Let us define the evidence for outcome A versus outcome B as:

mEmAmB

The analytical formula of the probability of outcome A is:

pA11+exp(βmE)

where β2μσ2.

Let us compare it, for values of mE ranging from 0.2 to 0.2, with the empirical probability we can get from our simulation, by running the model N times (for N sufficiently large) and computing:

P(A)Number of trials of outcome ANumber of trials of outcome A+Number of trials of outcome B

The problem is that we have to compute this empirical probability for several values of mE ranging from 0.2 to 0.2! As a matter of fact: the previous naive algorithm, based on the Euler method, is far too slow…

But we can cope with that with a trick!

Fast algorithm to compute the distribution of reaction times

From the discrete approximation of the drift-diffusion-model:

x(t+t)=x(t)+mEt+ση(t)t

So for all n1:

x(t+nt)=x(0)+nmEt+σti=1nηi(t)

where the

ηi(t)𝒩(0μi,1σi2)

are independent and normally distributed random variables.

But it is well known that a sum of independent and normally distributed random variables is also a normally distributed variable, such that:

i=1nηi(t)𝒩(i=1nμi,i=1nσi2)

i.e.

i=1nηi(t)𝒩(0,n)

But as it happens:

nη(t)𝒩(0,1)𝒩(0,n)

So for all n1, we can set x(t+nt) to be:

x(t+nt)=x(0)+nmEt+nσtη(t)

where η(t)𝒩(0,1)

So solving for n in the threshold crossing conditions:

x(t+nt)=±μ

is tantamount to:

  • Analysis: solving (for ξ, in ) two quadratic equations for a given η(t):

    {mEtξ2+σtη(t)ξ+x(0)μ=0(outcome A)mEtξ2+σtη(t)ξ+x(0)+μ=0(outcome A)
  • Synthesis: keeping only the roots ξ such that ξ2+, and setting nξ2

which gives us a very fast algorithm!

Figure 4.1.
Figure 2.1. - Distribution of reaction times for outcome A and B computed with the previous trick

Finally, we can compare the empirical probability of outcome A with the analytical one:

Figure 4.1.
Figure 2.2. - Comparison of the empirical probability of outcome A with pA (as functions of mE), for different values of μ
Figure 4.1.
Figure 2.3. - Comparison of the empirical probability of outcome A with pA (as functions of mE), for different values of μ

We see that the empirical probability of outcome A matches more and more pA (when it comes to the shape of the curve):

  • as μ increases

  • as σ decreases (with an almost perfect match above for σ=0.3)

Leave a comment