Learn R Programming

rtdists (version 0.2-6)

Diffusion: The Ratcliff Diffusion Model

Description

Density, distribution function, and random generation for the Ratcliff diffusion model with eight parameters: a (threshold separation), z (relative starting point), v (drift rate), t0 (non-decision time/response time constant), d (differences in speed of response execution), sv (inter-trial-variability of drift), st0 (inter-trial-variability of non-decisional components), and sz (inter-trial-variability of relative starting point).

Usage

drd(t, boundary = c("upper", "lower"), a, v, t0, z = 0.5, d = 0, sz = 0,
  sv = 0, st0 = 0, precision = 3)

prd(t, boundary = c("upper", "lower"), a, v, t0, z = 0.5, d = 0, sz = 0,
  sv = 0, st0 = 0, precision = 3, maxt = 10000)

rrd(n, a, v, t0, z = 0.5, d = 0, sz = 0, sv = 0, st0 = 0,
  precision = 3)

Arguments

t
a vector of RTs.
boundary
character vector. Which boundary should be tested. Possible values are c("upper", "lower"), possibly abbreviated and "upper" being the default.
a
threshold separation. Amount of information that is considered for a decision. Large values indicate a conservative decisional style. Typical range: 0.5 < a < 2
v
drift rate. Average slope of the information accumulation process. The drift gives information about the speed and direction of the accumulation of information. Large (absolute) values of drift indicate a good performance. If received information supports
t0
non-decision time or response time constant (in seconds). Average duration of all non-decisional processes (encoding and response execution). Typical range: 0.1 < t0 < 0.5
z
relative starting point. Indicator of an a priori bias in decision making. When the relative starting point z deviates from 0.5, the amount of information necessary for a decision differs between response alternatives. Typical range: 0.3 <
d
differences in speed of response execution (in seconds). Positive values indicate that response execution is faster for responses linked to the upper threshold than for responses linked to the lower threshold. Typical range: -0.1 < d < 0.1. D
sz
inter-trial-variability of (relative) starting point. Range of a uniform distribution with mean z describing the distribution of actual starting points from specific trials. Minimal impact on the RT distributions. Can be fixed to 0 in most ap
sv
inter-trial-variability of drift rate. Standard deviation of a normal distribution with mean v describing the distribution of actual drift rates from specific trials. Minimal impact on the RT distributions. Can be fixed to 0 in most appli
st0
inter-trial-variability of non-decisional components. Range of a uniform distribution with mean t0 describing the distribution of actual t0 values across trials. Accounts for response times below t0. Reduces skew of
precision
numerical scalar value. Precision of calculation. Corresponds roughly to the number of decimals of the predicted CDFs that are calculated accurately. Default is 3.
maxt
maximum rt allowed, used to stop integration problems (prd only).
n
desired number of observations.

Value

  • drd gives the density, prd gives the distribution function, and rrd generates random response times and decisions (returning a data.frame with columns rts (numeric) and response (factor)).

Details

The Ratcliff diffusion model (Ratcliff, 1978) is a mathematical model for two-choice discrimination tasks. It is based on the assumption that information is accumulated continuously until one of two decision thresholds is hit. For more information, see Voss, Rothermund, and Voss (2004), Voss, Nagler, and Lerche (2013), or Wagenmakers (2009).

References

Ratcliff, R. (1978). A theory of memory retrieval. Psychological Review, 85(2), 59-108. Voss, A., Rothermund, K., & Voss, J. (2004). Interpreting the parameters of the diffusion model: An empirical validation. Memory & Cognition. Vol 32(7), 32, 1206-1220. Voss, A., Nagler, M., & Lerche, V. (2013). Diffusion Models in Experimental Psychology: A Practical Introduction. Experimental Psychology, 60(6), 385-402. doi:10.1027/1618-3169/a000218 Wagenmakers, E.-J. (2009). Methodological and empirical developments for the Ratcliff diffusion model of response times and accuracy. European Journal of Cognitive Psychology, 21(5), 641-671.

Examples

Run this code
## identical calls (but different random values)
rrd(10, a=1, v=2, t0=0.5)
rrd(10, a=1, v=2, t0=0.5, z=0.5, d=0, sz=0, sv=0, st0=0)


# plot density:
curve(drd(x, a=1, v=2, t0=0.5, boundary = "upper"), 
      xlim=c(0,3), main="Density of upper responses", ylab="density", xlab="response time")
curve(drd(x, a=1, v=2, t0=0.5, st0=0.2, boundary = "upper"), 
      add=TRUE, lty = 2)
legend("topright", legend=c("no", "yes"), title = "Starting Point Variability?", lty = 1:2)

# plot cdf:
curve(prd(x, a=1, v=2, t0=0.5, st0=0.2, boundary="u"), 
     xlim = c(0, 3),ylim = c(0,1), 
     ylab = "cumulative probability", xlab = "response time",
     main = "CDF of diffusion model with start point variability")
curve(prd(x, a=1, v=2, t0=0.5, st0=0.2, boundary="l"), 
     add=TRUE, lty = 2)
legend("topleft", legend=c("upper", "lower"), title="boundary", lty=1:2)

Run the code above in your browser using DataLab