bmm
  • Get started
  • Functions
  • Articles
  • Changelog
  • Develop
  • Parameter recovery
  • Model explorer
  1. Response times
  2. EZ Diffusion 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. EZ Diffusion Model

EZ Diffusion Model

Two-choice response times, summarised: accuracy and the mean and variance of the response times

The task
3par: the evidence starts halfway between the boundaries, and the model uses the mean and variance of all response times together. 4par: the start, zr × bound, is free, and each response gets its own mean and variance. The summary panel shows this: one rt row in 3par, the start, and an upper and a lower row in 4par. In ezdm(): version.
Task settings
Trials in one cell of the design, a participant in a condition. It leaves the predicted statistics alone and sets how far the observed ones scatter around them: their variance shrinks with 1 / n_trials. At the start, 100 trials, the ±2 SD bands are ±0.10 around P(upper) = 0.5 and ±0.04 s around the mean response time of 0.47 s; at 25 trials both bands are twice as wide.
Parameters
Rate of evidence accumulation, the quality of the evidence. A positive drift favours the upper response, a negative one the lower; the larger it is in size, the faster the responses. At drift = 0 both responses are equally likely if the evidence starts halfway, as in 3par. At the start, drift = 0 gives a mean response time of 0.47 s; drift = 1 and −1 both give 0.45 s, with P(upper) 0.73 and 0.27.
Boundary separation: how much evidence is collected before responding. A larger bound slows the responses and, with a positive drift, makes more of them upper responses: 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 adds to the mean response time and leaves P(upper) and the variance alone. At the start, 0.22 s of the 0.47 s mean response time is non-decision time, the grey part of the rt row.
Relative starting point between the boundaries, from 0 (at the lower) to 1 (at the upper). Above 0.5 the evidence starts closer to the upper boundary: more upper responses, and faster ones. In 4par at the start values, zr = 0.7 gives P(upper) = 0.7, a mean upper response time of 0.39 s and a mean lower one of 0.53 s.
Predicted summary statistics
Grey: ndt; coloured: mean decision time; whiskers: ±1 SD of the rt, cut off at 0 s. Dashed: prior means.
Across trial counts
Draws N cells of n_trials trials each, as bmm's rezdm() does: the number of upper responses from a binomial, then the observed variance of the response times from a gamma distribution and their observed mean from a normal distribution given that variance, the sampling distributions dezdm() scores. In 4par the upper and the lower responses each get their own mean and variance; a cell with fewer than 2 responses at a boundary has no response-time statistics there (NA in bmm). Points at the dashed line: each cell's proportion of upper responses (top) and observed mean response time (bottom), spread sideways so that they do not hide each other; about 95% should fall inside the bands. In 4par a boundary's band is for the cells with at least 2 responses there, the ones that have points, and starts from about the first n_trials at which 1 cell in 1000 has them; a rare cell below that start is still drawn. Below the legend: the expected values, and in brackets this sample's: P(upper), the mean of the cells' observed mean response times (mean_rt), their SD across cells, and the mean of the observed variances (var_rt). The sample keeps its random numbers while the sliders move, so it changes with the parameters; New sample draws other ones. R draws its own sample, so its numbers differ from the page's.
Bands: ±2 SD of what one cell of n_trials trials would show, around the prediction (line). Dashed: the current n_trials.

What the model says

The EZ diffusion model (Wagenmakers et al., 2007) is the diffusion model (Ratcliff, 1978) fitted to summary statistics instead of single trials. Evidence starts between two boundaries, drifts at rate drift with noise, and the response is made when it first reaches the upper boundary at bound or the lower one at 0; the response time adds the non-decision time ndt. The diffusion model predicts three statistics in closed form: the probability of an upper response, and the mean and variance of the response time. With the noise s fixed at 1 and the start halfway between the boundaries (version 3par), and writing \(v\) = drift, \(a\) = bound and \(y = -va\),

\[ P(\text{upper}) = \frac{1}{1 + e^{y}}, \qquad \text{MRT} = \texttt{ndt} + \frac{a}{2v}\,\frac{1 - e^{y}}{1 + e^{y}}, \qquad \text{VRT} = \frac{a}{2v^3}\,\frac{2y e^{y} - e^{2y} + 1}{(e^{y} + 1)^2}. \]

At drift = 0 the two fractions are 0/0, and their limits are \(a^2/4\) for the mean decision time and \(a^4/24\) for its variance; bmm switches to a series near zero drift, and so does this page. The non-decision time adds to the mean and not to the variance; what remains of the response time is the decision time. With the start halfway, the decision time has the same distribution whichever boundary is reached, so 3par uses the mean and variance of all response times together. Version 4par lets the start, zr × bound, move; then the two responses differ in their decision times, and the model uses the mean and variance of each response separately (Srivastava et al., 2016).

The task

One trial is a choice between two responses, with the response time recorded. The model never sees the trials: it takes, for each cell of the design (a participant in a condition), the number of trials n_trials, the number of upper responses n_upper, and the mean mean_rt and variance var_rt of the response times, in seconds. ezdm_summary_stats() computes them from trial-level data. The task panel draws five evidence paths from the start under the current parameters, with the noise of each path held fixed while the sliders move; blue paths end at the upper boundary, orange ones at the lower. The paths illustrate the process; the statistics are computed from the formulas, not from them.

Explore

The panel Predicted summary statistics is the forward EZ map: the summary statistics the current parameters predict. The bar is P(upper), the probability of response 1. Below it is one row of response times in 3par and one per response in 4par: the grey part is ndt, the coloured part the mean decision time, and the whiskers one standard deviation (the square root of VRT) either side of the mean response time; where the SD exceeds the mean, the left whisker stops at 0 s. Moving drift away from 0 makes one response more likely (positive: the upper) and shortens and narrows the response times. Raising bound makes the responses slower and more variable and, for a drift other than 0, more often the one the drift favours. ndt shifts the mean and leaves the SD alone. In 4par, moving zr toward 1 makes upper responses more frequent and faster and lower responses slower.

Slider ranges come from bmm’s default priors for ezdm(). 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 predicted statistics do not depend on n_trials, but the likelihood does. The statistics of one cell are themselves data, and dezdm() scores them against how much they would vary from one sample of n_trials trials to the next (Chávez De la Peña & Vandekerckhove, 2025). The number of upper responses is binomial. The observed variance follows a gamma distribution with mean VRT; its sampling variance adds the fourth cumulant of the decision time, divided by the number of trials (in 4par, those at that boundary), to the term a normal sample would have. The observed mean, given the observed variance, follows a normal distribution, and the third cumulant, divided by the same number, is the covariance of the two, so the mean of that normal shifts with the observed variance. The panel Across trial counts shows the result: ±2 standard deviations of the observed P(upper) and of the observed mean response time around the prediction. Both bands narrow with the square root of n_trials, so a cell with more trials pins the parameters down more tightly. In 4par, each response’s mean comes from the trials that ended at that boundary only, so a rare response has a wide band. A boundary reached fewer than twice has no variance; dezdm() then drops that boundary’s response-time terms and keeps the binomial term for n_upper and, if the other boundary has at least 2 responses, the other boundary’s response-time terms (rezdm() returns NA for them). The number of responses at a boundary is itself binomial, so a response’s band is for the cells that have at least 2 of them: its variance is VRT times the mean of 1 / count over those cells, the same SD as the “SD across cells” below the legend. Where such cells are rare it narrows less than the square root of n_trials says. The band starts from about the first n_trials at which at least 1 cell in 1000 has 2 responses at that boundary (exactly up to 30 trials, at the next of the panel’s steps above that).

In bmm


  

The code updates with the controls. ezdm() defines the model from the names of the columns that hold the summary statistics (two names each for mean_rt and var_rt in 4par: upper, then lower). dezdm() returns the log likelihood of one cell’s statistics; the call here passes the statistics the current parameters predict for n_trials trials, rounded as shown, and the comment under it holds the value this page computes for them. bmf() writes the formula for bmm(), which estimates the parameters from one row per cell; my_data stands for your own data, and fitting runs Stan through brms. See the EZ diffusion article for the sampling model and for ezdm_summary_stats(), and the reference pages for ezdm() and dezdm().

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.