dt2_dfddm  R Documentation 
SecondOrder Partial Derivative of the density function for the 5parameter
variant of the Ratcliff diffusion decision model (DDM) with respect to t,
the response time. This variant contains the following parameters:
v
(drift rate), a
(threshold separation),
t0
(nondecision time/response time constant), w
(relative starting point), sv
(intertrial variability of drift),
and sigma
(diffusion coefficient of underlying Wiener process).
dt2_dfddm(
rt,
response,
v,
a,
t0,
w = 0.5,
sv = 0,
sigma = 1,
sl_thresh = 0.5,
err_tol = 1e06
)
rt 
A vector of response times (in seconds). If a response time is
nonpositve, then its density will evaluate to 
response 
Binary response(s) that correspond(s) to either the "lower" or "upper" threshold. This model parameter can either be a singular value or a vector. The value(s) in 'response' can be of the following data types:

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 the response linked to
the upper threshold, then the sign will be positive; similarly a negative
value indicates that the received information supports the response linked
to the lower threshold. Allowed range: 
a 
Threshold separation. Amount of information that is considered for
a decision. Large values indicate a conservative decisional style. Allowed
range: 
t0 
Nondecision time or response time constant (in seconds). Lower
bound for the duration of all nondecisional processes (encoding and
response execution). If this value is greater than 
w 
Relative starting point. Indicator of an a priori bias in decision
making. When the relative starting point 
sv 
Intertrialvariability of drift rate. Standard deviation of a
normal distribution with mean 
sigma 
Diffusion coefficient of the underlying Wiener process. Allowed
range:
. 
sl_thresh 
Threshold for deciding when to use the "smalltime" variant
or the "largetime" variant. If the "effective response time" is greater
than 
err_tol 
Allowed error tolerance of the overall calculation. Since the
partial derivative of the density function contains the sum of two
infinite sums, each approximation of these two infinite sums will have an
individual error tolerance of 
All of the model inputs and parameters (rt
, response
,
v
, a
, t0
, w
, sv
, sigma
) can be
input as a single value or as a vector of values. If input as a vector of
values, then the standard R
input wrapping will occur.
sv
 Both the "smalltime" and "largetime" variants of the density
function have two further variants: one with a constant drift rate v
(i.e., sv
= 0
), and one with a variable drift rate v
(i.e., sv
> 0
). The details of the differences between these
two density functions can be found in our associated paper. To use the
density function with a constant drift rate, leave the parameter sv
to its default value of sv = 0
, as this will indicate no drift to the
function. To use the density function with a variable drift rate, set the
parameter sv
to some nonnegative value, i.e., sv
> 0
.
sigma
 The default value of this parameter is 1
because it
only scales the parameters v
, a
, and sv
, as shown
above. However, other formulations of the DDM may set sigma = 0.1
(see Ratcliff (1978), the fourth reference), so care must be taken when
comparing the results of different formulations.
A vector containing the secondorder partial derivatives of the
DDM PDF with precision err_tol
whose length matches that of the
longest input parameter (usually rt
).
Navarro, D. J., & Fuss, I. G. (2009). Fast and accurate calculations for firstpassage times in Wiener diffusion models. Journal of Mathematical Psychology, 53(4), 222230.
Gondan, M., Blurton, S. P., & Kesselmeier, M. (2014). Even faster and even more accurate firstpassage time densities and distributions for the Wiener diffusion model. Journal of Mathematical Psychology, 60, 2022.
Blurton, S. P., Kesselmeier, M., & Gondan, M. (2017). The firstpassage time distribution for the diffusion model with variable drift. Journal of Mathematical Psychology, 76, 712.
Hartmann, R., Klauer, K. C. (2021). Partial derivatives for the firstpassage time distribution in Wiener diffusion models. Journal of Mathematical Psychology, 103, 102550.
Ratcliff, R. (1978). A theory of memory retrieval. Psychological review, 85(2), 59.
# derivative with respect to rt (response time)
dt_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
sv = 0.4, err_tol = 1e6)
# derivative with respect to t0 (nondecision time)
dt0_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
sv = 0.4, err_tol = 1e6)
# derivative with respect to a (threshold separation)
da_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
sv = 0.4, err_tol = 1e6)
# derivative with respect to v (drift rate)
dv_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
sv = 0.4, err_tol = 1e6)
# derivative with respect to w (relative starting point)
dw_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
sv = 0.4, err_tol = 1e6)
# derivative with respect to sv (intertrial variability in the drift rate)
dsv_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
sv = 0.4, err_tol = 1e6)
# Log Versions #
# # derivative with respect to rt (response time)
# dt_log_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
# sv = 0.4, err_tol = 1e6)
# # derivative with respect to t0 (nondecision time)
# dt0_log_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
# sv = 0.4, err_tol = 1e6)
# # derivative with respect to a (threshold separation)
# da_log_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
# sv = 0.4, err_tol = 1e6)
# # derivative with respect to v (drift rate)
# dv_log_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
# sv = 0.4, err_tol = 1e6)
# # derivative with respect to w (relative starting point)
# dw_log_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
# sv = 0.4, err_tol = 1e6)
# # derivative with respect to sv (intertrial variability in the drift rate)
# dsv_log_dfddm(rt = 1.2, response = "lower", a = 1, v = 1, t0 = 0.3, w = 0.5,
# sv = 0.4, err_tol = 1e6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.