bmm
  • Get started
  • Functions
  • Articles
  • Changelog
  • Develop
  • Parameter recovery
  • Model explorer
  1. Response times
  2. Diffusion Decision Model
  • All models
  • How to read a page
  • Categorical decision tasks
    • Memory Measurement Model
    • Multinomial processing tree, span task
  • Continuous reproduction tasks
    • Interference Measurement Model
    • Two-parameter mixture model
    • Three-parameter mixture model
    • Signal discrimination model
  • Signal detection
    • Signal detection theory, yes/no
    • Signal detection theory, m-alternative forced choice
    • Signal detection theory, confidence ratings
  • Response times
    • EZ Diffusion Model
    • Censored Shifted Wald Model
    • Diffusion Decision Model
  1. Response times
  2. Diffusion Decision Model

Diffusion Decision Model

Two-choice response times: noisy evidence drifts between two boundaries until it reaches one

The task
Task settings

No task setting enters the likelihood. A trial is one response time and one of two responses; the density uses those two and nothing else about the trial.

Parameters
Average rate of evidence accumulation, the quality of the evidence. A positive drift favours the upper response (1), a negative one the lower (0); the larger it is in size, the faster and more consistent the responses. At the start, drift = 0 gives P(upper) = 0.5; drift = 1 raises it to 0.73 and shortens the mean response time from 0.47 s to 0.45 s.
Boundary separation: how much evidence the participant waits for. A larger bound gives slower responses that more often follow the drift: speed traded for accuracy. At drift = 0, the start, only the slowing shows: bound 1 → 2 moves the mean response time from 0.47 s to 1.22 s. At drift = 1 the same step also raises P(upper) from 0.73 to 0.88.
Non-decision time in seconds, for encoding the stimulus and executing the response. It shifts both response-time densities to the right and changes no response probability. At the start, 0.22 s of the 0.47 s mean response time is non-decision time.
Relative starting point between the lower (0) and the upper (1) boundary. Above 0.5 the participant leans toward the upper response before any evidence arrives: more upper responses, and faster ones. At the start, drift = 0, moving zr from 0.5 to 0.7 raises P(upper) from 0.5 to 0.7 and shortens the mean upper response time from 0.47 s to 0.39 s.
Predicted response times
Draws N trials from the model: each trial's response with probability P(upper), and its response time from that response's density. Grey bars behind the curves: the sample's response times in 40 bins across the time axis, upper responses above the axis and lower ones below. The bars of a response have that response's share of the trials as their area, as its curve does. A response time beyond the axis has no bar. Below the legend: the expected P(upper) and each response's mean and SD of the response time, and in brackets the same for this sample, with the number of trials in the sample that gave each response after its name; a response with few trials gives values far from the expected ones. The sample keeps its random numbers while the sliders move, so it changes with the parameters; New sample draws other ones. In bmm: rddm(), in the code under In bmm; R draws its own sample, so its numbers differ from the page's.
Upper above the axis, lower below; each area is that response's probability. Dashed: prior means.
Speed and accuracy as bound changes
The line runs over bound from 0.22 to 4.48, the other parameters as set; circle: now. Dashed: prior means.

What the model says

The diffusion decision model (DDM; Ratcliff, 1978; Ratcliff & McKoon, 2008) describes a two-choice decision as the accumulation of noisy evidence. Evidence starts at zr × bound, moves on average at rate drift with noise of standard deviation 1 per second, and the decision is made when it first reaches the upper boundary at bound (response 1) or the lower boundary at 0 (response 0). The response time adds the non-decision time ndt, for encoding the stimulus and executing the response. drift is the quality of the evidence; a positive drift favours the upper response, a negative one the lower. bound is how much evidence the participant waits for, and zr is a bias toward one response before any evidence arrives.

For a response at the lower boundary at decision time \(t\) = rt − ndt, with \(v\) = drift, \(a\) = bound and \(z_r\) = zr, the density is

\[ f_0(t) = \frac{\pi}{a^2}\, e^{-v a z_r - v^2 t / 2} \sum_{k=1}^{\infty} k\, e^{-k^2 \pi^2 t / (2 a^2)} \sin(k \pi z_r), \]

and \(f_1(t)\), the density at the upper boundary, is the same with \(v\) replaced by \(-v\) and \(z_r\) by \(1 - z_r\): the same process seen upside down. Each of the two is a defective density: its area is the probability of that response, and the two areas sum to 1. The noise per unit time, s, is fixed at 1 in bmm; it sets the scale on which the other parameters are measured.

The task

One trial is a choice between two responses, with the response time recorded: a brightness or a lexical decision, for example. bmm codes the responses 0 (lower) and 1 (upper); which response is which is the analyst’s choice, often correct as 1 and error as 0. The task panel draws five evidence paths from the same start under the current parameters, with the noise of each path held fixed while the sliders move. Paths that end at the upper boundary are blue, those that end at the lower boundary orange. The grey band is the non-decision time, the dashed line is the mean path, the start plus drift × time, and the bracket on the right marks bound. The paths illustrate the process; they are not data.

Explore

The density panel shows the two defective densities, upper responses above the axis and lower responses below. Raising drift moves area from the lower to the upper density. Moving it away from 0, in either direction, makes both faster: the response-time distribution of each response depends on the size of drift, not on its sign. Raising bound makes both slower and more spread out and, for a drift other than 0, moves area toward the response the drift favours. ndt shifts both densities without changing their shape. Moving zr toward 1 makes upper responses more frequent and faster and lower responses rarer and slower. P(upper), the probability of response 1, and the mean response times in the readout come from exact formulas for this process, the same ones the EZ diffusion page uses.

Slider ranges come from bmm’s default priors for ddm(). bound is estimated on the log scale with a normal(0, 0.5) prior, ndt on the log scale with normal(−1.5, 0.5), and zr on the logit scale with normal(0, 0.5); each slider spans the prior mean ± 3 SD: bound from 0.22 to 4.48, ndt from 0.05 to 1 s, zr from 0.18 to 0.82. drift has an identity link and a cauchy(0, 1) prior, which has no standard deviation; its slider spans the location ± 3 scale, from −3 to 3. The sliders start at the prior means (dashed): drift = 0, bound = 1, ndt = 0.22 s, zr = 0.5. With no drift and the start in the middle, both responses are equally likely.

Across task settings

The likelihood of ddm() has no task-setting variable. Conditions of an experiment, for example easy and hard stimuli or instructions to be fast or accurate, enter only if the bmm formula lets the parameters differ between them, as in drift ~ 0 + difficulty. What the model then predicts in each condition follows from the estimated parameters.

Speed and accuracy are both outcomes of the same parameters, and the panel Speed and accuracy as bound changes shows how they trade. As bound grows from 0.22 to 4.48 with the other parameters fixed, the mean response time grows, and P(upper) moves toward 1 for a positive drift (toward 0 for a negative one). With drift at 0 the line is flat: waiting for more evidence costs time and buys no accuracy, because the evidence favours neither response. bmm’s DDM article reads bound as response caution, the parameter behind a speed/accuracy trade-off, and drift as the quality of the evidence or the difficulty of the task.

In bmm


  

The code updates with the controls. ddm() defines the model, dddm() returns the log density of response times and responses, and bmf() writes the formula for bmm(), which estimates the parameters from trial-level data; my_data stands for your own data, and fitting runs Stan through brms. The comment under the dddm() call holds the values this page computes for it. dddm() calls rtdists::ddiffusion(), which sums either the series above or a second series that converges faster at short decision times, whichever needs fewer terms, and stops after enough terms for an absolute error of about 10⁻⁶ in the density. Where a density is very small, far in a tail, an error of that size is large against the value, so the cut-off decides it; this page follows the same rule, so it shows what bmm returns. See the DDM article for the full model and the reference pages for ddm() and dddm().

bmm model explorer · source · code GPL-2, text CC BY 4.0

 
  • Report an issue

Built with Quarto. No R, no server: everything runs in your browser.