Censored Shifted Wald Model
Two-choice response times with few errors: evidence accumulates toward the correct response
simple: one accumulator, for the correct response. An error counts as a censored trial: by the error's response time the accumulator had not arrived. At the start, an error at 1 s has likelihood 0.39, the probability that no correct response has come by then. crisk (competing risks): one accumulator per response, and the first to arrive gives the response. In cswald(): version.No task setting enters the likelihood. A trial is one response time and one of two responses; the likelihood uses those two and nothing else about the trial.
simple it is the rate of the correct response's accumulator and must be positive; bmm estimates it on the log scale. At the start, drift = 1 gives a mean correct response time of 1.14 s, and drift = 2 shortens it to 0.64 s. In crisk the upper accumulator runs at drift and the lower at −drift, so a negative drift favours the lower response.simple, the distance from the start to the correct boundary, half the boundary separation of the diffusion model; in crisk, the full separation of the two boundaries. At the start, simple with bound = 1 is compared with a diffusion model with bound = 2, the wide grey band, and gives a mean correct response time of 1.14 s.crisk, drift = 0 and bound = 1, moving zr from 0.5 to 0.7 raises P(upper) from 0.5 to 0.74.rcswald() does: from the diffusion model in this panel (wide grey), which this model approximates, in both versions (simple and crisk), not from the thin curves of this model. Each trial's response comes with the diffusion model's P(upper), its response time from that response's density. Grey bars: 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. A response time beyond the axis has no bar. Below the legend: the diffusion model's 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. In simple the diffusion model's boundary separation is twice bound, with the start in the middle, and the rcswald() call under In bmm passes that separation as bound. 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.What the model says
The censored shifted Wald model (Miller et al., 2018) is a simplification of the diffusion model (Ratcliff & McKoon, 2008) for tasks with few errors. Evidence for the correct response accumulates at rate drift with noise until it reaches bound; the time this takes follows a Wald (inverse Gaussian) distribution, and the response time adds the non-decision time ndt. For a response at decision time \(t\) = rt − ndt, with \(v\) = drift, \(a\) = bound and the noise s fixed at 1, the density is
\[ f(t) = \frac{a}{\sqrt{2\pi t^3}} \exp\left(-\frac{(a - v t)^2}{2t}\right). \]
In the simple version there is no second boundary for errors. An error at time \(t\) is a censored observation: a trial on which the correct response had not been reached by \(t\). It enters the likelihood with the survival function \(S(t) = 1 - F(t)\), where \(F\) is the cumulative distribution of the Wald: the probability that the accumulator is still on its way. bound here is the distance from the start to the correct boundary, half the boundary separation of the diffusion model (the distance between its two boundaries), and drift is positive. The competing-risks version crisk gives each response its own accumulator. Both start at zr × bound, where zr is the relative starting point between 0 and 1; one runs the distance (1 − zr) × bound to the upper boundary with rate drift, the other the distance zr × bound to the lower boundary with rate −drift, and the first to arrive gives the response. The likelihood of a response at \(t\) is its own accumulator’s Wald density times the other accumulator’s survival at \(t\). In crisk, bound is the full boundary separation and drift can be negative, as in the diffusion model.
The task
One trial is a choice between two responses, with the response time recorded; bmm codes them 0 (lower) and 1 (upper), and in this model 1 is usually the correct response. The task panel draws the accumulation under the current parameters, with the noise held fixed while the sliders move. In simple one accumulator rises from the start toward bound; an error has no boundary of its own and stops the accumulator before it arrives. In crisk the two accumulators run at once, each in its own lane: the upper one from the start up, the lower one from the start down. An accumulator that wanders away from its boundary leaves its lane for a while, and the one that loses the race is drawn fainter.
Explore
In simple, the blue curve is the density of a correct response at each response time and the orange curve the likelihood of an error at that time, the probability that no correct response has come yet. They share the axis, but one is a density and the other a probability. In crisk the two curves are defective densities, upper responses above the axis and lower responses below, and each area is the probability of that response. In simple, raising drift makes correct responses faster and less variable: the decision time has mean \(a/v\) and variance \(a/v^3\). In crisk, raising drift moves area from lower to upper responses, and moving it away from 0 in either direction makes the response it works against faster and less variable. At drift 0 neither accumulator has a finite mean finishing time, so both responses have long tails. The response drift favours changes differently: its median and interquartile range first grow as drift leaves 0 and shrink only at larger drifts. Raising bound makes responses slower and more spread out. ndt shifts everything. The time axis ends at 6 s at most.
Slider ranges come from bmm’s default priors for cswald(). In simple, drift is estimated on the log scale with a normal(0, 1) prior, bound on the log scale with normal(0, 0.3), and ndt on the log scale with normal(−2, 0.3); each slider spans the prior mean ± 3 SD: drift from 0.05 to 20.1, bound from 0.41 to 2.46, ndt from 0.05 to 0.33 s. In crisk, drift has an identity link and a normal(0, 1) prior, so it runs from −3 to 3; bound and ndt keep their ranges, and zr is estimated on the logit scale with normal(0, 0.3), from 0.29 to 0.71. bmm fixes zr at 0.5 unless the formula estimates it. The sliders start at the prior means (dashed). Switching the version restarts the parameters there, since drift and bound mean different things in the two versions.
Across task settings
The likelihood of cswald() has no task-setting variable. Conditions of an experiment enter only if the bmm formula lets the parameters differ between them, as in drift ~ 0 + condition; what the model then predicts in each condition follows from the estimated parameters.
What does change across tasks is how good the approximation is, and the panel Compared with the diffusion model shows it. It draws this model’s curves over the diffusion model’s with the same parameters; for simple, the diffusion model gets twice bound as its boundary separation and its start in the middle. Its readout gives the diffusion model’s probability of a lower response, the error rate the comparison is about. When the diffusion model gives few lower responses, the correct-response densities nearly coincide. As errors become frequent, they part: simple has no density for errors at all and keeps all its area on correct responses, while the diffusion model moves area to the lower boundary. In crisk both models have both densities; they come close when the readout’s P(lower) is near 0 or 1 and differ most when it is near 0.5. bmm’s cswald article recommends simple for error rates below 20% and crisk above.
In bmm
The code updates with the controls. cswald() defines the model, dcswald() returns the log likelihood 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 dcswald() call holds the values this page computes for it. To compare bound across versions or with ddm(), multiply the simple estimate by 2. See the cswald article for the full model and the reference pages for cswald() and dcswald().