Package 'ream'

Title: Density, Distribution, and Sampling Functions for Evidence Accumulation Models
Description: Calculate the probability density functions (PDFs) for two threshold evidence accumulation models (EAMs). These are defined using the following Stochastic Differential Equation (SDE), dx(t) = v(x(t),t)*dt+D(x(t),t)*dW, where x(t) is the accumulated evidence at time t, v(x(t),t) is the drift rate, D(x(t),t) is the noise scale, and W is the standard Wiener process. The boundary conditions of this process are the upper and lower decision thresholds, represented by b_u(t) and b_l(t), respectively. Upper threshold b_u(t) > 0, while lower threshold b_l(t) < 0. The initial condition of this process x(0) = z where b_l(t) < z < b_u(t). We represent this as the relative start point w = z/(b_u(0)-b_l(0)), defined as a ratio of the initial threshold location. This package generates the PDF using the same approach as the 'python' package it is based upon, 'PyBEAM' by Murrow and Holmes (2023) <doi:10.3758/s13428-023-02162-w>. First, it converts the SDE model into the forwards Fokker-Planck equation dp(x,t)/dt = d(v(x,t)*p(x,t))/dt-0.5*d^2(D(x,t)^2*p(x,t))/dx^2, then solves this equation using the Crank-Nicolson method to determine p(x,t). Finally, it calculates the flux at the decision thresholds, f_i(t) = 0.5*d(D(x,t)^2*p(x,t))/dx evaluated at x = b_i(t), where i is the relevant decision threshold, either upper (i = u) or lower (i = l). The flux at each thresholds f_i(t) is the PDF for each threshold, specifically its PDF. We discuss further details of this approach in this package and 'PyBEAM' publications. Additionally, one can calculate the cumulative distribution functions of and sampling from the EAMs.
Authors: Raphael Hartmann [aut, cre] , Matthew Murrow [aut]
Maintainer: Raphael Hartmann <[email protected]>
License: GPL (>= 2)
Version: 1.0-5
Built: 2024-10-26 05:57:18 UTC
Source: https://github.com/raphaelhartmann/ream

Help Index


Continuous Dual-Stage Two-Phase Model of Selective Attention

Description

A continuous approximation of the Dual-Stage Two-Phase model of conflict tasks. The Dual-Stage Two-Phase model assumes that choice in conflict tasks involves two processes: a decision process and a target selection process. The target selection process is an SDDM, while the decision process is an SDDM but with drift rate

v(x,t)=(1w(t))(μt+cμnt)+w(t)μ2,v(x,t) = (1 - w(t))*(\mu_t + c*\mu_{nt}) + w(t)*\mu_2,

where w(t)=0w(t) = 0 before target selection and w(t)=1w(t) = 1 after target selection. A full derivation of this model is in the ream publication.

Usage

dCDSTP(rt, resp, phi, x_res = "default", t_res = "default")

pCDSTP(rt, resp, phi, x_res = "default", t_res = "default")

rCDSTP(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Relative start of the target selection process (wtsw_{ts}). Sets the start point of accumulation for the target selection process as a ratio of the two decision thresholds. Related to the absolute start ztsz_{ts} point via equation zts=blts+wts(butsblts)z_{ts} = b_{lts} + w_ts*(b_{uts} – b_{lts}).

  4. Target stimulus strength (μt\mu_t).

  5. Congruence parameter (cc). Set experiment congruency. In congruent condition c=1c = 1, in incongruent condition c=1c = -1, and in neutral condition c=0c = 0.

  6. Non-target stimulus strength (μnt\mu_{nt}).

  7. Drift rate following target selection i.e. stage 2 (μ2\mu_2).

  8. Target selection drift rate (μts\mu_{ts}).

  9. Noise scale (σ\sigma). Model scaling parameter.

  10. Effective noise scale of continuous approximation (σeff\sigma_{eff}). See ream publication for full description.

  11. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  12. Target selection decision thresholds (btsb_{ts}). Sets the location of each decision threshold for the target selection process. The upper threshold butsb_{uts} is above 0 and the lower threshold bltsb_{lts} is below 0 such that buts=blts=btsb_{uts} = -b_{lts} = b_{ts}. The threshold separation ats=2btsa_{ts} = 2b_{ts}.

  13. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  14. Lower bound of contamination distribution (glg_l). See parameter gg.

  15. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hübner, R., Steinhauser, M., & Lehle, C. (2010). A dual-stage two-phase model of selective attention. Psychological review, 117(3), 759.

Examples

# Probability density function
dCDSTP(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
       phi = c(0.3, 0.5, 0.5, -0.5, -1.0, -0.5, 8.0, 4.0, 1.0, 2.0, 1.3, 1.3, 0.0, 0.0, 1.0))

# Cumulative distribution function
pCDSTP(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
       phi = c(0.3, 0.5, 0.5, -0.5, -1.0, -0.5, 8.0, 4.0, 1.0, 2.0, 1.3, 1.3, 0.0, 0.0, 1.0))

# Random sampling
rCDSTP(n = 100, phi = c(0.3, 0.5, 0.5, -0.5, -1.0, -0.5, 8.0, 4.0, 1.0, 2.0, 1.3, 1.3,
                        0.0, 0.0, 1.0), dt = 0.001)

Custom Time-Dependent Drift Diffusion Model

Description

Density (PDF), distribution function (CDF), and random sampler for a custom time-dependent (CSTM_T) drift diffusion model.

Usage

dCSTM_T(rt, resp, phi, x_res = "default", t_res = "default")

pCSTM_T(rt, resp, phi, x_res = "default", t_res = "default")

rCSTM_T(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in your specified order

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods, 1-21.

Examples

# Probability density function
dCSTM_T(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
      phi = c(0.3, 0.5, 1.0, 1.0, 0.75, 0.0, 0.0, 1.0))

Custom Time- and Weight-Dependent Drift Diffusion Model

Description

Density (PDF), distribution function (CDF), and random sampler for a custom time- and weight-dependent (CSTM_TW) drift diffusion model.

Usage

dCSTM_TW(rt, resp, phi, x_res = "default", t_res = "default")

pCSTM_TW(rt, resp, phi, x_res = "default", t_res = "default")

rCSTM_TW(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in your specified order

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods, 1-21.


Custom Time- and Evidence-Dependent Drift Diffusion Model

Description

Density (PDF), distribution function (CDF), and random sampler for a custom time- and evidence-dependent (CSTM_TX) drift diffusion model.

Usage

dCSTM_TX(rt, resp, phi, x_res = "default", t_res = "default")

pCSTM_TX(rt, resp, phi, x_res = "default", t_res = "default")

rCSTM_TX(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in your specified order

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods, 1-21.


Generate Grid for PDF of the Continuous Dual-Stage Two-Phase Model of Selective Attention

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dCDSTP.

Usage

dCDSTP_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Relative start of the target selection process (wtsw_{ts}). Sets the start point of accumulation for the target selection process as a ratio of the two decision thresholds. Related to the absolute start ztsz_{ts} point via equation zts=blts+wts(butsblts)z_{ts} = b_{lts} + w_ts*(b_{uts} – b_{lts}).

  4. Target stimulus strength (μt\mu_t).

  5. Congruence parameter (cc). Set experiment congruency. In congruent condition c=1c = 1, in incongruent condition c=1c = -1, and in neutral condition c=0c = 0.

  6. Non-target stimulus strength (μnt\mu_{nt}).

  7. Drift rate following target selection i.e. stage 2 (μ2\mu_2).

  8. Target selection drift rate (μts\mu_{ts}).

  9. Noise scale (σ\sigma). Model scaling parameter.

  10. Effective noise scale of continuous approximation (σeff\sigma_{eff}). See ream publication for full description.

  11. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  12. Target selection decision thresholds (btsb_{ts}). Sets the location of each decision threshold for the target selection process. The upper threshold butsb_{uts} is above 0 and the lower threshold bltsb_{lts} is below 0 such that buts=blts=btsb_{uts} = -b_{lts} = b_{ts}. The threshold separation ats=2btsa_{ts} = 2b_{ts}.

  13. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  14. Lower bound of contamination distribution (glg_l). See parameter gg.

  15. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hübner, R., Steinhauser, M., & Lehle, C. (2010). A dual-stage two-phase model of selective attention. Psychological review, 117(3), 759.


Generate Grid for PDF of Custom Time-Dependent Drift Diffusion Model

Description

Beschreibung.

Usage

dCSTM_T_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in your order

x_res

spatial/evidence resolution

t_res

time resolution

Value

such and such

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods.


Generate Grid for PDF of Custom Time- and Weight-Dependent Drift Diffusion Model

Description

Beschreibung.

Usage

dCSTM_TW_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in your order

x_res

spatial/evidence resolution

t_res

time resolution

Value

such and such

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods.


Generate Grid for PDF of Custom Time- and Evidence-Dependent Drift Diffusion Model

Description

Beschreibung.

Usage

dCSTM_TX_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in your order

x_res

spatial/evidence resolution

t_res

time resolution

Value

such and such

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods.


Generate Grid for PDF of Diffusion Model of Conflict Tasks

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dDMC.

Usage

dDMC_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Coherence parameter (ss). Sets stimulus coherence. If s=1s = 1, coherent condition; if s=0s = 0, neutral condition; if s=1s = -1, incoherent condition.

  4. Automatic process amplitude (AA). Max value of automatic process.

  5. Scale parameter (τ\tau). Contributes to time automatic process. Time to max tmax=(α1)τt_{max} = (\alpha – 1)*\tau.

  6. Shape parameter (α\alpha). Indicates the shape of the automatic process. Must have value more than 1 (α>1\alpha > 1).

  7. Drift rate of the controlled process (μc\mu_c).

  8. Noise scale (σ\sigma). Model noise scale parameter.

  9. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  10. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  11. Lower bound of contamination distribution (glg_l). See parameter gg.

  12. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Ulrich, R., Schröter, H., Leuthold, H., & Birngruber, T. (2015). Automatic and controlled stimulus processing in conflict tasks: Superimposed diffusion processes and delta functions. Cognitive psychology, 78, 148-174.


Generate Grid for PDF of the Exponential Threshold Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dETM.

Usage

dETM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Log10-rate of threshold change (log10(τ)log_{10}(\tau)).

  7. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  8. Lower bound of contamination distribution (glg_l). See parameter gg.

  9. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods, 56(3), 2636-2656.


Generate Grid for PDF of the Leaky Integration Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dLIM.

Usage

dLIM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus.

  4. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  5. Noise scale (σ\sigma). Model scaling parameter.

  6. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  7. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  8. Lower bound of contamination distribution (glg_l). See parameter gg.

  9. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Busemeyer, J. R., & Townsend, J. T. (1993). Decision field theory: A dynamic-cognitive approach to decision making in an uncertain environment. Psychological Review, 100(3), 432-459.

Usher, M., & McClelland, J. L. (2001). The time course of perceptual choice: The leaky, competing accumulator model. Psychological Review, 108(3), 550-592.

Wang, J.-S., & Donkin, C. (2024). The neural implausibility of the diffusion decision model doesn’t matter for cognitive psychometrics, but the Ornstein-Uhlenbeck model is better. Psychonomic Bulletin & Review.

Wong, K.-F., & Wang, X.-J. (2006). A Recurrent Network Mechanism of Time Integration in Perceptual Decisions. The Journal of Neuroscience, 26(4), 1314-1328.


Generate Grid for PDF of the Leaky Integration Model With Flip

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dLIMF.

Usage

dLIMF_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength 1 (μ1\mu_1). Strength of the stimulus prior to t0t_0.

  4. Stimulus strength 2 (μ2\mu_2). Strength of the stimulus after t0t_0.

  5. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  6. Flip-time (t0t_0). Time when stimulus strength changes.

  7. Noise scale (σ\sigma). Model scaling parameter.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Evans, N. J., Trueblood, J. S., & Holmes, W. R. (2019). A parameter recovery assessment of time-variant models of decision-making. Behavior Research Methods, 52(1), 193-206.

Trueblood, J. S., Heathcote, A., Evans, N. J., & Holmes, W. R. (2021). Urgency, leakage, and the relative nature of information processing in decision-making. Psychological Review, 128(1), 160-186.


Generate Grid for PDF of the Linear Threshold Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dLTM.

Usage

dLTM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Decision threshold slope (mm).

  7. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  8. Lower bound of contamination distribution (glg_l). See parameter gg.

  9. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods, 56(3), 2636-2656.


Diffusion Model for Conflict Tasks

Description

The DMC is a two-process evidence accumulation model for the study of conflict tasks. It sums together a controlled and an automatic process to generate a single accumulator for generating the likelihood function. This accumulator has the same parameters as the SDDM with the exception of the drift rate, given by

v(x,t)=sAexp(t/τ)[et/(τ(α1))]α1[(α1)/t1/τ]+μc.v(x,t) = s*A*exp(-t/\tau)*[e*t/(\tau*(\alpha-1))]^{\alpha-1}*[(\alpha-1)/t - 1/\tau] + \mu_c.

Usage

dDMC(rt, resp, phi, x_res = "default", t_res = "default")

pDMC(rt, resp, phi, x_res = "default", t_res = "default")

rDMC(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Coherence parameter (ss). Sets stimulus coherence. If s=1s = 1, coherent condition; if s=0s = 0, neutral condition; if s=1s = -1, incoherent condition.

  4. Automatic process amplitude (AA). Max value of automatic process.

  5. Scale parameter (τ\tau). Contributes to time automatic process. Time to max tmax=(α1)τt_{max} = (\alpha – 1)*\tau.

  6. Shape parameter (α\alpha). Indicates the shape of the automatic process. Must have value more than 1 (α>1\alpha > 1).

  7. Drift rate of the controlled process (μc\mu_c).

  8. Noise scale (σ\sigma). Model noise scale parameter.

  9. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  10. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  11. Lower bound of contamination distribution (glg_l). See parameter gg.

  12. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Ulrich, R., Schröter, H., Leuthold, H., & Birngruber, T. (2015). Automatic and controlled stimulus processing in conflict tasks: Superimposed diffusion processes and delta functions. Cognitive psychology, 78, 148-174.

Examples

# Probability density function
dDMC(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, -1.0, 0.2, 0.05, 2.5, 3.0, 1.0, 0.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pDMC(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, -1.0, 0.2, 0.05, 2.5, 3.0, 1.0, 0.5, 0.0, 0.0, 1.0))

# Random sampling
rDMC(n = 100, phi = c(0.3, 0.5, -1.0, 0.2, 0.05, 2.5, 3.0, 1.0, 0.5, 0.0, 0.0, 1.0))

Generate Grid for PDF of Piecewise Attention Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dPAM.

Usage

dPAM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Perceptual input strength of outer units (pouterp_{outer}).

  4. Perceptual input strength of inner units (pinnerp_{inner}).

  5. Perceptual input strength of target (ptargetp_{target}).

  6. Target selection time (tst_s).

  7. Noise scale (σ\sigma). Model noise scale parameter.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

White, C. N., Ratcliff, R., & Starns, J. J. (2011). Diffusion models of the flanker task: Discrete versus gradual attentional selection. Cognitive Psychology, 63(4), 210-238.


Generate Grid for PDF of the Revised Diffusion Model of Conflict Tasks

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dRDMC.

Usage

dRDMC_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Automatic process amplitude (A0A_0). Max value of automatic process.

  4. Attention shift parameter (kk). Encodes congruency and thus differs between congruent and incongruent trials.

  5. Base drift rate of the automatic channel (dad_a).

  6. Base drift rate of the controlled channel (dcd_c).

  7. Noise scale (σ\sigma). Model noise scale parameter.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Lee, P.-S., & Sewell, D. K. (2023). A revised diffusion model for conflict tasks. Psychonomic Bulletin & Review, 31(1), 1–31.


Generate Grid for PDF of the Rational Threshold Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dRTM.

Usage

dRTM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Amount of decision threshold collapse (κ\kappa).

  7. Semi-saturation constant (t0.5t_{0.5}). The semi-saturation constant is the value of time at which the boundaries have collapsed by half κ\kappa.

  8. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  9. Lower bound of contamination distribution (glg_l). See parameter gg.

  10. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Churchland, A. K., Kiani, R., & Shadlen, M. N. (2008). Decision-making with multiple alternatives. Nature Neuroscience, 11(6), 693-702.

Hanks, T. D., Mazurek, M. E., Kiani, R., Hopp, E., & Shadlen, M. N. (2011). Elapsed Decision Time Affects the Weighting of Prior Probability in a Perceptual Decision Task. The Journal of Neuroscience, 31(17), 6339-6352.

Voskuilen, C., Ratcliff, R., & Smith, P. L. (2016). Comparing fixed and collapsing boundary versions of the diffusion model. Journal of Mathematical Psychology, 73, 59-79.


Generate Grid for PDF of the Simple Drift Diffusion Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dSDDM.

Usage

dSDDM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For the SDDM, v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model scaling parameter.

  5. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  6. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  7. Lower bound of contamination distribution (glg_l). See parameter gg.

  8. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Ratcliff, R. (1978). A theory of memory retrieval. Psychological Review, 85(2), 59-108.

Ratcliff, R., & McKoon, G. (2008). The Diffusion Decision Model: Theory and Data for Two-Choice Decision Tasks. Neural Computation, 20(4), 873-922.


Generate Grid for PDF of the Sequential Dual Process Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dSDPM.

Usage

dSDPM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Relative start of the target selection process (wtsw_{ts}). Sets the start point of accumulation for the target selection process as a ratio of the two decision thresholds. Related to the absolute start ztsz_{ts} point via equation zts=blts+wts(butsblts)z_{ts} = b_{lts} + w_ts*(b_{uts} – b_{lts}).

  4. Stimulus strength (μ\mu).

  5. Stimulus strength of process 2 (μ2\mu_2).

  6. Noise scale (σ\sigma). Model scaling parameter.

  7. Effective noise scale of continuous approximation (σeff\sigma_{eff}). See ream publication for full description.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Target selection decision thresholds (btsb_{ts}). Sets the location of each decision threshold for the target selection process. The upper threshold butsb_{uts} is above 0 and the lower threshold bltsb_{lts} is below 0 such that buts=blts=btsb_{uts} = -b_{lts} = b_{ts}. The threshold separation ats=2btsa_{ts} = 2b_{ts}.

  10. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  11. Lower bound of contamination distribution (glg_l). See parameter gg.

  12. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hübner, R., Steinhauser, M., & Lehle, C. (2010). A dual-stage two-phase model of selective attention. Psychological Review, 117(3), 759-784.


Generate Grid for PDF of the Shrinking Spotlight Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dSSP.

Usage

dSSP_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Width of the attentional spotlight (sda0sd_{a0}). Initial standard deviation of the attentional process.

  4. Linear rate of spotlight decrease (rdr_d). Spotlight width sda(t)=sda0rdtsd_a(t) = sd_{a0} - r_d*t.

  5. Congruency parameter (cc). In congruent condition c=1c = 1, in incongruent condition c=1c = -1, and in neutral condition c=0c = 0.

  6. Lower bound of target’s attentional allocation (lbtargetlb_{target}). Typically fixed to -0.5.

  7. Upper bound of target’s attentional allocation (ubtargetub_{target}). Typically fixed to 0.5.

  8. Upper bound of inner units attentional allocation (ubinnerub_{inner}). Typically fixed to 1.5.

  9. Perceptual input strength of target (ptargetp_{target}).

  10. Perceptual input strength of inner units (pinnerp_{inner}).

  11. Perceptual input strength of outer units (pouterp_{outer}).

  12. Noise scale (σ\sigma). Model noise scale parameter.

  13. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  14. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  15. Lower bound of contamination distribution (glg_l). See parameter gg.

  16. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

White, C. N., Ratcliff, R., & Starns, J. J. (2011). Diffusion models of the flanker task: Discrete versus gradual attentional selection. Cognitive Psychology, 63(4), 210–238.


Generate Grid for PDF of the Urgency Gating Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dUGM.

Usage

dUGM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (E0E_0). Strength of the stimulus.

  4. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  5. Log10-urgency (log10(k)log_{10}(k)). Decision urgency. If kk is small, the choice is dominated by leakage and approximates a LM. If kk is large, it is an urgency dominated decision.

  6. Noise scale (σ\sigma). Model scaling parameter.

  7. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  8. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  9. Lower bound of contamination distribution (glg_l). See parameter gg.

  10. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Cisek, P., Puskas, G. A., & El-Murr, S. (2009). Decisions in changing conditions: the urgency-gating model. Journal of Neuroscience, 29(37), 11560-11571.

Trueblood, J. S., Heathcote, A., Evans, N. J., & Holmes, W. R. (2021). Urgency, leakage, and the relative nature of information processing in decision-making. Psychological Review, 128(1), 160-186.


Generate Grid for PDF of the Urgency Gating Model With Flip

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dUGMF.

Usage

dUGMF_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength before the flip (E01E_{01}).

  4. Stimulus strength after the flip (E02E_{02}).

  5. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  6. Log10-urgency (log10(k)log_{10}(k)). Decision urgency. If kk is small, the choice is dominated by leakage and approximates a LIM. If kk is large, it is an urgency dominated decision.

  7. Flip-time (t0t_0). Time when stimulus strength changes.

  8. Noise scale (σ\sigma). Model scaling parameter.

  9. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  10. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  11. Lower bound of contamination distribution (glg_l). See parameter gg.

  12. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Cisek, P., Puskas, G. A., & El-Murr, S. (2009). Decisions in changing conditions: the urgency-gating model. Journal of Neuroscience, 29(37), 11560-11571.

Trueblood, J. S., Heathcote, A., Evans, N. J., & Holmes, W. R. (2021). Urgency, leakage, and the relative nature of information processing in decision-making.


Generate Grid for PDF of the Weibull Dual-Stage Two-Phase Model of Selective Attention

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dWDSTP.

Usage

dWDSTP_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Relative start of the target selection process (wtsw_{ts}). Sets the start point of accumulation for the target selection process as a ratio of the two decision thresholds. Related to the absolute start ztsz_{ts} point via equation zts=blts+wts(butsblts)z_{ts} = b_{lts} + w_ts*(b_{uts} – b_{lts}).

  4. Target stimulus strength (μt\mu_t).

  5. Congruence parameter (cc). Set experiment congruency. In congruent condition c=1c = 1, in incongruent condition c=1c = -1, and in neutral condition c=0c = 0.

  6. Non-target stimulus strength (μnt\mu_{nt}).

  7. Drift rate following target selection i.e. stage 2 (μ2\mu_2).

  8. Scale parameter for Weibull function (λ\lambda).

  9. Shape parameter for Weibull function (κ\kappa).

  10. Noise scale (σ\sigma). Model scaling parameter.

  11. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  12. Target selection decision thresholds (btsb_{ts}). Sets the location of each decision threshold for the target selection process. The upper threshold butsb_{uts} is above 0 and the lower threshold bltsb_{lts} is below 0 such that buts=blts=btsb_{uts} = -b_{lts} = b_{ts}. The threshold separation ats=2btsa_{ts} = 2b_{ts}.

  13. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  14. Lower bound of contamination distribution (glg_l). See parameter gg.

  15. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hübner, R., Steinhauser, M., & Lehle, C. (2010). A dual-stage two-phase model of selective attention. Psychological Review, 117(3), 759-784.


Generate Grid for PDF of the Weibull Threshold Model

Description

Generate a grid of response-time values and the corresponding PDF values. For more details on the model see, for example, dWTM.

Usage

dWTM_grid(rt_max = 10, phi, x_res = "default", t_res = "default")

Arguments

rt_max

maximal response time <- max(rt)

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Log10-decision threshold scale (log10(λ)log_{10}(\lambda)). Sets the approximate time for threshold collapse or rise.

  7. Log10-decision threshold shape (log10(κ)log_{10}(\kappa)). Sets the threshold shape. κ>1\kappa > 1 produces logistic-like thresholds, κ<1\kappa < 1 produces exponential-like thresholds.

  8. Collapse parameter (cc). Sets the amount of collapse. c=1c = -1 gives collapse to zero, c=1c = 1 gives no collapse, and c>1c > 1 gives rise.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

Value

list of RTs and corresponding defective PDFs at lower and upper threshold

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hawkins, G. E., Forstmann, B. U., Wagenmakers, E.-J., Ratcliff, R., & Brown, S. D. (2015). Revisiting the Evidence for Collapsing Boundaries and Urgency Signals in Perceptual Decision-Making. The Journal of Neuroscience, 35(6), 2476-2484.

Palestro, J. J., Weichart, E., Sederberg, P. B., & Turner, B. M. (2018). Some task demands induce collapsing bounds: Evidence from a behavioral analysis. Psychonomic Bulletin & Review, 25(4), 1225-1248.


Exponential Threshold Model

Description

SDDM with thresholds that change with time. Thresholds are symmetric exponential functions of the form bu(t)=bl(t)=b0exp(t/τ)b_u(t) = -b_l(t) = b_0*exp(-t/\tau).

Usage

dETM(rt, resp, phi, x_res = "default", t_res = "default")

pETM(rt, resp, phi, x_res = "default", t_res = "default")

rETM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Log10-rate of threshold change (log10(τ)log_{10}(\tau)).

  7. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  8. Lower bound of contamination distribution (glg_l). See parameter gg.

  9. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods, 56(3), 2636-2656.

Examples

# Probability density function
dETM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pETM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.5, 0.0, 0.0, 1.0))

# Random sampling
rETM(n = 100, phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.5, 0.0, 0.0, 1.0))

Leaky Integration Model

Description

SDDM modified to encode leaky integration in the drift rate. Also known as an Ornstein-Uhlenbeck model, its drift rate is v(x,t)=μLxv(x,t) = \mu - L*x where LL is the leakage rate. All other parameters are unchanged from the SDDM. Leakage describes the rate at which old information is lost from the accumulator, occurring on a time scale of approximately 1/L1/L. The LIM is used to model decay of excitatory currents in decision neurons (Usher & McClelland, 2001; Wong & Wang, 2006) and has been proposed as a mechanism for preference reversals under time pressure (Busemeyer & Townsend, 1993). Due to its neural plausibility and simple functional form, recent work has proposed it as an alternative psychometric tool to the SDDM (Wang & Donkin, 2024).

Usage

dLIM(rt, resp, phi, x_res = "default", t_res = "default")

pLIM(rt, resp, phi, x_res = "default", t_res = "default")

rLIM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus.

  4. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  5. Noise scale (σ\sigma). Model scaling parameter.

  6. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  7. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  8. Lower bound of contamination distribution (glg_l). See parameter gg.

  9. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Busemeyer, J. R., & Townsend, J. T. (1993). Decision field theory: A dynamic-cognitive approach to decision making in an uncertain environment. Psychological Review, 100(3), 432-459.

Usher, M., & McClelland, J. L. (2001). The time course of perceptual choice: The leaky, competing accumulator model. Psychological Review, 108(3), 550-592.

Wang, J.-S., & Donkin, C. (2024). The neural implausibility of the diffusion decision model doesn’t matter for cognitive psychometrics, but the Ornstein-Uhlenbeck model is better. Psychonomic Bulletin & Review.

Wong, K.-F., & Wang, X.-J. (2006). A Recurrent Network Mechanism of Time Integration in Perceptual Decisions. The Journal of Neuroscience, 26(4), 1314-1328.

Examples

# Probability density function
dLIM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 0.5, 1.0, 0.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pLIM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 0.5, 1.0, 0.5, 0.0, 0.0, 1.0))

# Random sampling
rLIM(n = 100, phi = c(0.3, 0.5, 1.0, 0.5, 1.0, 0.5, 0.0, 0.0, 1.0))

Leaky Integration Model With Flip

Description

LIM with time varying drift rate. Specifically, the stimulus strength changes from μ1\mu_1 to μ2\mu_2 at time t0t_0. Identified by (Evans et al., 2020; Trueblood et al., 2021) as a way to improve recovery of the leakage rate. Drift rate becomes v(x,t)=μ1Lxv(x,t) = \mu_1 - L*x if t<t0t < t_0 and v(x,t)=μ2Lxv(x,t) = \mu_2 - L*x if t>=t0.t >= t_0.

Usage

dLIMF(rt, resp, phi, x_res = "default", t_res = "default")

pLIMF(rt, resp, phi, x_res = "default", t_res = "default")

rLIMF(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength 1 (μ1\mu_1). Strength of the stimulus prior to t0t_0.

  4. Stimulus strength 2 (μ2\mu_2). Strength of the stimulus after t0t_0.

  5. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  6. Flip-time (t0t_0). Time when stimulus strength changes.

  7. Noise scale (σ\sigma). Model scaling parameter.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Evans, N. J., Trueblood, J. S., & Holmes, W. R. (2019). A parameter recovery assessment of time-variant models of decision-making. Behavior Research Methods, 52(1), 193-206.

Trueblood, J. S., Heathcote, A., Evans, N. J., & Holmes, W. R. (2021). Urgency, leakage, and the relative nature of information processing in decision-making. Psychological Review, 128(1), 160-186.

Examples

# Probability density function
dLIMF(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 0.9, 0.5, 0.5, 1.0, 0.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pLIMF(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 0.9, 0.5, 0.5, 1.0, 0.5, 0.0, 0.0, 1.0))

# Random sampling
rLIMF(n = 100, phi = c(0.3, 0.5, 1.0, 0.9, 0.5, 0.5, 1.0, 0.5, 0.0, 0.0, 1.0))

Linear Threshold Model

Description

SDDM with thresholds that change with time. Thresholds are symmetric linear functions of the form bu(t)=bl(t)=b0mtb_u(t) = -b_l(t) = b_0 - m*t.

Usage

dLTM(rt, resp, phi, x_res = "default", t_res = "default")

pLTM(rt, resp, phi, x_res = "default", t_res = "default")

rLTM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Decision threshold slope (mm).

  7. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  8. Lower bound of contamination distribution (glg_l). See parameter gg.

  9. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Murrow, M., & Holmes, W. R. (2023). PyBEAM: A Bayesian approach to parameter inference for a wide class of binary evidence accumulation models. Behavior Research Methods, 56(3), 2636-2656.

Examples

# Probability density function
dLTM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 1.0, 0.0, 0.0, 1.0))

# Cumulative distribution function
pLTM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 1.0, 0.0, 0.0, 1.0))

# Random sampling
rLTM(n = 100, phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 1.0, 0.0, 0.0, 1.0))

Piecewise Attention Model

Description

The PAM (aka dual-process model) is an evidence accumulation model developed to study cognition in conflict tasks like the Eriksen flanker task. It is similar to the SSP, but instead of a gradual narrowing of attention, target selection is discrete. Its total drift rate is

v(x,t)=2aouterpouter+2ainnerpinner+atargetptarget,v(x,t) = 2*a_{outer}*p_{outer} + 2*a_{inner}*p_{inner} + a_{target}*p_{target},

where ainnera_{inner} and aouttera_{outter} are 0 if t>=tst >= t_s and 1 otherwise. The PAM otherwise maintains the parameters of the SDDM.

Usage

dPAM(rt, resp, phi, x_res = "default", t_res = "default")

pPAM(rt, resp, phi, x_res = "default", t_res = "default")

rPAM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Perceptual input strength of outer units (pouterp_{outer}).

  4. Perceptual input strength of inner units (pinnerp_{inner}).

  5. Perceptual input strength of target (ptargetp_{target}).

  6. Target selection time (tst_s).

  7. Noise scale (σ\sigma). Model noise scale parameter.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

White, C. N., Ratcliff, R., & Starns, J. J. (2011). Diffusion models of the flanker task: Discrete versus gradual attentional selection. Cognitive Psychology, 63(4), 210-238.

Examples

# Probability density function
dPAM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.25, 0.5, -0.3, -0.3, 0.3, 0.25, 1.0, 0.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pPAM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.25, 0.5, -0.3, -0.3, 0.3, 0.25, 1.0, 0.5, 0.0, 0.0, 1.0))

# Random sampling
rPAM(n = 100, phi = c(0.25, 0.5, -0.3, -0.3, 0.3, 0.25, 1.0, 0.5, 0.0, 0.0, 1.0))

Revised Diffusion Model of Conflict Tasks

Description

A DMC-like model which modifies the shape of the controlled and automatic processes to ensure consistent stimulus representation across the task. It maintains all SDDM parameters outside the drift rate which is v(x,t)=wa(t)da+wc(t)dcv(x,t) = w_a(t)*d_a + w_c(t)*d_c, where wa(t)=A0exp(kt)w_a(t) = A_0*exp(-k*t) and wc(t)=1wa(t)w_c(t) = 1 - w_a(t).

Usage

dRDMC(rt, resp, phi, x_res = "default", t_res = "default")

pRDMC(rt, resp, phi, x_res = "default", t_res = "default")

rRDMC(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Automatic process amplitude (A0A_0). Max value of automatic process.

  4. Attention shift parameter (kk). Encodes congruency and thus differs between congruent and incongruent trials.

  5. Base drift rate of the automatic channel (dad_a).

  6. Base drift rate of the controlled channel (dcd_c).

  7. Noise scale (σ\sigma). Model noise scale parameter.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Lee, P.-S., & Sewell, D. K. (2023). A revised diffusion model for conflict tasks. Psychonomic Bulletin & Review, 31(1), 1–31.

Examples

# Probability density function
dRDMC(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.35, 0.5, 7.5, 40.0, 5.0, 5.0, 1.0, 0.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pRDMC(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.35, 0.5, 7.5, 40.0, 5.0, 5.0, 1.0, 0.5, 0.0, 0.0, 1.0))

# Random sampling
rRDMC(n = 100, phi = c(0.35, 0.5, 7.5, 40.0, 5.0, 5.0, 1.0, 0.5, 0.0, 0.0, 1.0))

Rational Threshold Model

Description

SDDM with thresholds that change with time. Thresholds are rational functions of the form

bu(t)=bl(t)=0.5b0(1κt/(t+t0.5)).b_u(t) = -b_l(t) = 0.5*b_0*(1 - \kappa*t/(t + t_{0.5})).

Usage

dRTM(rt, resp, phi, x_res = "default", t_res = "default")

pRTM(rt, resp, phi, x_res = "default", t_res = "default")

rRTM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Amount of decision threshold collapse (κ\kappa).

  7. Semi-saturation constant (t0.5t_{0.5}). The semi-saturation constant is the value of time at which the boundaries have collapsed by half κ\kappa.

  8. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  9. Lower bound of contamination distribution (glg_l). See parameter gg.

  10. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Churchland, A. K., Kiani, R., & Shadlen, M. N. (2008). Decision-making with multiple alternatives. Nature Neuroscience, 11(6), 693-702.

Hanks, T. D., Mazurek, M. E., Kiani, R., Hopp, E., & Shadlen, M. N. (2011). Elapsed Decision Time Affects the Weighting of Prior Probability in a Perceptual Decision Task. The Journal of Neuroscience, 31(17), 6339-6352.

Voskuilen, C., Ratcliff, R., & Smith, P. L. (2016). Comparing fixed and collapsing boundary versions of the diffusion model. Journal of Mathematical Psychology, 73, 59-79.

Examples

# Probability density function
dRTM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.5, 0.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pRTM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.5, 0.5, 0.0, 0.0, 1.0))

# Random sampling
rRTM(n = 100, phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.5, 0.5, 0.0, 0.0, 1.0))

Simple Drift Diffusion Model

Description

Density (PDF), distribution function (CDF), and random sampler for the simple drift diffusion model (SDDM) without across-trial variabilities.

Usage

dSDDM(rt, resp, phi, x_res = "default", t_res = "default")

pSDDM(rt, resp, phi, x_res = "default", t_res = "default")

rSDDM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For the SDDM, v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model scaling parameter.

  5. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  6. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  7. Lower bound of contamination distribution (glg_l). See parameter gg.

  8. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Ratcliff, R. (1978). A theory of memory retrieval. Psychological Review, 85(2), 59-108.

Ratcliff, R., & McKoon, G. (2008). The Diffusion Decision Model: Theory and Data for Two-Choice Decision Tasks. Neural Computation, 20(4), 873-922.

Examples

# Probability density function
dSDDM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
      phi = c(0.3, 0.5, 1.0, 1.0, 0.75, 0.0, 0.0, 1.0))

# Cumulative distribution function
pSDDM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
      phi = c(0.3, 0.5, 1.0, 1.0, 0.75, 0.0, 0.0, 1.0))

# Random sampling
rSDDM(n = 100, phi = c(0.3, 0.5, 1.0, 1.0, 0.75, 0.0, 0.0, 1.0))

Sequential Dual Process Model

Description

The Sequential Dual Process Model (SDPM) is similar in principle to the DSTP, but instead of simultaneous accumulators, it contains sequential accumulator s. Its drift rate is given by v(x,t)=w(t)μv(x,t) = w(t)*\mu where w(t)w(t) is 0 if the second process hasn't crossed a threshold yet and 1 if it has. The noise scale has a similar structure D(x,t)=w(t)σD(x,t) = w(t)*\sigma.

Usage

dSDPM(rt, resp, phi, x_res = "default", t_res = "default")

pSDPM(rt, resp, phi, x_res = "default", t_res = "default")

rSDPM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Relative start of the target selection process (wtsw_{ts}). Sets the start point of accumulation for the target selection process as a ratio of the two decision thresholds. Related to the absolute start ztsz_{ts} point via equation zts=blts+wts(butsblts)z_{ts} = b_{lts} + w_ts*(b_{uts} – b_{lts}).

  4. Stimulus strength (μ\mu).

  5. Stimulus strength of process 2 (μ2\mu_2).

  6. Noise scale (σ\sigma). Model scaling parameter.

  7. Effective noise scale of continuous approximation (σeff\sigma_{eff}). See ream publication for full description.

  8. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  9. Target selection decision thresholds (btsb_{ts}). Sets the location of each decision threshold for the target selection process. The upper threshold butsb_{uts} is above 0 and the lower threshold bltsb_{lts} is below 0 such that buts=blts=btsb_{uts} = -b_{lts} = b_{ts}. The threshold separation ats=2btsa_{ts} = 2b_{ts}.

  10. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  11. Lower bound of contamination distribution (glg_l). See parameter gg.

  12. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hübner, R., Steinhauser, M., & Lehle, C. (2010). A dual-stage two-phase model of selective attention. Psychological Review, 117(3), 759-784.

Examples

# Probability density function
dSDPM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
      phi = c(0.3, 1.0, 0.5, 1.0, 1.0, 1.0, 1.0, 0.75, 0.75, 0.0, 0.0, 1.0))

# Cumulative distribution function
pSDPM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
      phi = c(0.3, 1.0, 0.5, 1.0, 1.0, 1.0, 1.0, 0.75, 0.75, 0.0, 0.0, 1.0))

# Random sampling
rSDPM(n = 100, phi = c(0.3, 1.0, 0.5, 1.0, 1.0, 1.0, 1.0, 0.75, 0.75, 0.0, 0.0, 1.0),
      dt = 0.001)

Shrinking Spotlight Model

Description

The SSP is an evidence accumulation model developed to study cognition in conflict tasks like the Eriksen flanker task. It is based on theories of visual attention and assumes that attention acts like a shrinking spotlight which is gradually narrowed on the target. It maintains all SDDM parameters outside of the drift rate. A full description of the model is in the REAM publication.

Usage

dSSP(rt, resp, phi, x_res = "default", t_res = "default")

pSSP(rt, resp, phi, x_res = "default", t_res = "default")

rSSP(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Width of the attentional spotlight (sda0sd_{a0}). Initial standard deviation of the attentional process.

  4. Linear rate of spotlight decrease (rdr_d). Spotlight width sda(t)=sda0rdtsd_a(t) = sd_{a0} - r_d*t.

  5. Congruency parameter (cc). In congruent condition c=1c = 1, in incongruent condition c=1c = -1, and in neutral condition c=0c = 0.

  6. Lower bound of target’s attentional allocation (lbtargetlb_{target}). Typically fixed to -0.5.

  7. Upper bound of target’s attentional allocation (ubtargetub_{target}). Typically fixed to 0.5.

  8. Upper bound of inner units attentional allocation (ubinnerub_{inner}). Typically fixed to 1.5.

  9. Perceptual input strength of target (ptargetp_{target}).

  10. Perceptual input strength of inner units (pinnerp_{inner}).

  11. Perceptual input strength of outer units (pouterp_{outer}).

  12. Noise scale (σ\sigma). Model noise scale parameter.

  13. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  14. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  15. Lower bound of contamination distribution (glg_l). See parameter gg.

  16. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

White, C. N., Ratcliff, R., & Starns, J. J. (2011). Diffusion models of the flanker task: Discrete versus gradual attentional selection. Cognitive Psychology, 63(4), 210–238.

Examples

# Probability density function
dSSP(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 7.5, -1.0, -0.5, 0.5, 1.5, 3.75, 3.75, 3.75, 1.0,
             0.75, 0.0, 0.0, 1.0))

# Cumulative distribution function
pSSP(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 7.5, -1.0, -0.5, 0.5, 1.5, 3.75, 3.75, 3.75, 1.0,
             0.75, 0.0, 0.0, 1.0))

# Random sampling
rSSP(n = 100, phi = c(0.3, 0.5, 1.0, 7.5, -1.0, -0.5, 0.5, 1.5, 3.75, 3.75, 3.75,
                      1.0, 0.75, 0.0, 0.0, 1.0))

Urgency Gating Model

Description

The Urgency Gating Model (UGM) is a decision-making model which proposes that stimulus information is first low pass filtered, then used to update the decision state through a time varying gain function (Cisek et al., 2009). Though not initially formulated as an EAM, following the procedure of (Trueblood et al., 2021) it can be written as one. Doing so modifies the drift rate to

v(x,t)=E0(1+kt)+(k/(1+kt)L)x.v(x,t) = E_0*(1 + k*t) + (k/(1+k*t) - L)*x.

Usage

dUGM(rt, resp, phi, x_res = "default", t_res = "default")

pUGM(rt, resp, phi, x_res = "default", t_res = "default")

rUGM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (E0E_0). Strength of the stimulus.

  4. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  5. Log10-urgency (log10(k)log_{10}(k)). Decision urgency. If kk is small, the choice is dominated by leakage and approximates a LM. If kk is large, it is an urgency dominated decision.

  6. Noise scale (σ\sigma). Model scaling parameter.

  7. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  8. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  9. Lower bound of contamination distribution (glg_l). See parameter gg.

  10. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Cisek, P., Puskas, G. A., & El-Murr, S. (2009). Decisions in changing conditions: the urgency-gating model. Journal of Neuroscience, 29(37), 11560-11571.

Trueblood, J. S., Heathcote, A., Evans, N. J., & Holmes, W. R. (2021). Urgency, leakage, and the relative nature of information processing in decision-making.

Examples

# Probability density function
dUGM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 0.5, 0.5, 1.0, 1.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pUGM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 0.5, 0.5, 1.0, 1.5, 0.0, 0.0, 1.0))

# Random sampling
rUGM(n = 100, phi = c(0.3, 0.5, 1.0, 0.5, 0.5, 1.0, 1.5, 0.0, 0.0, 1.0))

Urgency Gating Model With Flip

Description

UGM with time varying drift rate. Specifically, the stimulus strength changes from E01E_{01} to E02E_{02} at time t0t_0. Identified by (Trueblood et al., 2021) as a way to improve recovery of the leakage rate and urgency. Drift rate becomes

v(x,t)=E01(1+kt)+(k/(1+kt)L)x  if  t<t0v(x,t) = E_{01}*(1 + k*t) + (k/(1+k*t) - L)*x \ \text{ if } \ t < t_0

and

v(x,t)=E02(1+kt)+(k/(1+kt)L)x  if  t>=t0.v(x,t) = E_{02}*(1 + k*t) + (k/(1+k*t) - L)*x \ \text{ if } \ t >= t_0.

Usage

dUGMF(rt, resp, phi, x_res = "default", t_res = "default")

pUGMF(rt, resp, phi, x_res = "default", t_res = "default")

rUGMF(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength before the flip (E01E_{01}).

  4. Stimulus strength after the flip (E02E_{02}).

  5. Log10-leakage (log10(L)log_{10}(L)). Rate of leaky integration.

  6. Log10-urgency (log10(k)log_{10}(k)). Decision urgency. If kk is small, the choice is dominated by leakage and approximates a LIM. If kk is large, it is an urgency dominated decision.

  7. Flip-time (t0t_0). Time when stimulus strength changes.

  8. Noise scale (σ\sigma). Model scaling parameter.

  9. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  10. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  11. Lower bound of contamination distribution (glg_l). See parameter gg.

  12. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Cisek, P., Puskas, G. A., & El-Murr, S. (2009). Decisions in changing conditions: the urgency-gating model. Journal of Neuroscience, 29(37), 11560-11571.

Trueblood, J. S., Heathcote, A., Evans, N. J., & Holmes, W. R. (2021). Urgency, leakage, and the relative nature of information processing in decision-making.

Examples

# Probability density function
dUGMF(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
      phi = c(0.3, 0.5, 1.0, 0.9, 0.5, 0.5, 0.5, 1.0, 1.5, 0.0, 0.0, 1.0))

# Cumulative distribution function
pUGMF(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
      phi = c(0.3, 0.5, 1.0, 0.9, 0.5, 0.5, 0.5, 1.0, 1.5, 0.0, 0.0, 1.0))

# Random sampling
rUGMF(n = 100, phi = c(0.3, 0.5, 1.0, 0.9, 0.5, 0.5, 0.5, 1.0, 1.5, 0.0, 0.0, 1.0))

Weibull Dual-Stage Two-Phase Model of Selective Attention

Description

A continuous approximation of the Dual-Stage Two-Phase model of conflict tasks. The Dual-Stage Two-Phase model assumes that choice in conflict tasks involves two processes: a decision process and a target selection process. Unlike the CDSTP, the target selection process here is a Weibull cumulative distribution function. The decision process is an SDDM but with drift rate

v(x,t)=(1w(t))(μt+cμnt)+w(t)μ2,v(x,t) = (1 - w(t))*(\mu_t + c*\mu_{nt}) + w(t)*\mu_2,

where w(t)=0w(t) = 0 before target selection and w(t)=1w(t) = 1 after target selection. A full derivation of this model is in the ream publication.

Usage

dWDSTP(rt, resp, phi, x_res = "default", t_res = "default")

pWDSTP(rt, resp, phi, x_res = "default", t_res = "default")

rWDSTP(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Relative start of the target selection process (wtsw_{ts}). Sets the start point of accumulation for the target selection process as a ratio of the two decision thresholds. Related to the absolute start ztsz_{ts} point via equation zts=blts+wts(butsblts)z_{ts} = b_{lts} + w_ts*(b_{uts} – b_{lts}).

  4. Target stimulus strength (μt\mu_t).

  5. Congruence parameter (cc). Set experiment congruency. In congruent condition c=1c = 1, in incongruent condition c=1c = -1, and in neutral condition c=0c = 0.

  6. Non-target stimulus strength (μnt\mu_{nt}).

  7. Drift rate following target selection i.e. stage 2 (μ2\mu_2).

  8. Scale parameter for Weibull function (λ\lambda).

  9. Shape parameter for Weibull function (κ\kappa).

  10. Noise scale (σ\sigma). Model scaling parameter.

  11. Decision thresholds (bb). Sets the location of each decision threshold. The upper threshold bub_u is above 0 and the lower threshold blb_l is below 0 such that bu=bl=bb_u = -b_l = b. The threshold separation a=2ba = 2b.

  12. Target selection decision thresholds (btsb_{ts}). Sets the location of each decision threshold for the target selection process. The upper threshold butsb_{uts} is above 0 and the lower threshold bltsb_{lts} is below 0 such that buts=blts=btsb_{uts} = -b_{lts} = b_{ts}. The threshold separation ats=2btsa_{ts} = 2b_{ts}.

  13. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  14. Lower bound of contamination distribution (glg_l). See parameter gg.

  15. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hübner, R., Steinhauser, M., & Lehle, C. (2010). A dual-stage two-phase model of selective attention. Psychological Review, 117(3), 759-784.

Examples

# Probability density function
dWDSTP(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
       phi = c(0.3, 0.5, 1.0, 1.0, -1.0, -0.5, 8.0, 1.0, 1.0, 1.0, 2.0, 1.3, 0.0, 0.0, 1.0))

# Cumulative distribution function
pWDSTP(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
       phi = c(0.3, 0.5, 1.0, 1.0, -1.0, -0.5, 8.0, 1.0, 1.0, 1.0, 2.0, 1.3, 0.0, 0.0, 1.0))

# Random sampling
rWDSTP(n = 100, phi = c(0.3, 0.5, 1.0, 1.0, -1.0, -0.5, 8.0, 1.0, 1.0, 1.0, 2.0, 1.3,
                        0.0, 0.0, 1.0))

Weibull Threshold Model

Description

SDDM with thresholds that change with time. Thresholds are Weibull functions of the form bu(t)=bl(t)=b0b0(1c)[1exp((t/λ)κ)].b_u(t) = -b_l(t) = b_0 - b_0*(1 – c)*[1 - exp(-(t/\lambda)^{\kappa})].

Usage

dWTM(rt, resp, phi, x_res = "default", t_res = "default")

pWTM(rt, resp, phi, x_res = "default", t_res = "default")

rWTM(n, phi, dt = 1e-05)

Arguments

rt

vector of response times

resp

vector of responses ("upper" and "lower")

phi

parameter vector in the following order:

  1. Non-decision time (tndt_{nd}). Time for non-decision processes such as stimulus encoding and response execution. Total decision time t is the sum of the decision and non-decision times.

  2. Relative start (ww). Sets the start point of accumulation as a ratio of the two decision thresholds. Related to the absolute start z point via equation z=bl+w(bubl)z = b_l + w*(b_u - b_l).

  3. Stimulus strength (μ\mu). Strength of the stimulus and used to set the drift rate. For changing threshold models v(x,t)=μv(x,t) = \mu.

  4. Noise scale (σ\sigma). Model noise scale parameter.

  5. Initial decision threshold location (b0b_0). Sets the location of each decision threshold at time t=0t = 0.

  6. Log10-decision threshold scale (log10(λ)log_{10}(\lambda)). Sets the approximate time for threshold collapse or rise.

  7. Log10-decision threshold shape (log10(κ)log_{10}(\kappa)). Sets the threshold shape. κ>1\kappa > 1 produces logistic-like thresholds, κ<1\kappa < 1 produces exponential-like thresholds.

  8. Collapse parameter (cc). Sets the amount of collapse. c=1c = -1 gives collapse to zero, c=1c = 1 gives no collapse, and c>1c > 1 gives rise.

  9. Contamination (gg). Sets the strength of the contamination process. Contamination process is a uniform distribution fc(t)f_c(t) where fc(t)=1/(gugl)f_c(t) = 1/(g_u-g_l) if gl<=t<=gug_l <= t <= g_u and fc(t)=0f_c(t) = 0 if t<glt < g_l or t>gut > g_u. It is combined with PDF fi(t)f_i(t) to give the final combined distribution fi,c(t)=gfc(t)+(1g)fi(t)f_{i,c}(t) = g*f_c(t) + (1-g)*f_i(t), which is then output by the program. If g=0g = 0, it just outputs fi(t)f_i(t).

  10. Lower bound of contamination distribution (glg_l). See parameter gg.

  11. Upper bound of contamination distribution (gug_u). See parameter gg.

x_res

spatial/evidence resolution

t_res

time resolution

n

number of samples

dt

step size of time. We recommend 0.00001 (1e-5)

Value

For the density a list of PDF values, log-PDF values, and the sum of the log-PDFs, for the distribution function a list of of CDF values, log-CDF values, and the sum of the log-CDFs, and for the random sampler a list of response times (rt) and response thresholds (resp).

Author(s)

Raphael Hartmann & Matthew Murrow

References

Hawkins, G. E., Forstmann, B. U., Wagenmakers, E.-J., Ratcliff, R., & Brown, S. D. (2015). Revisiting the Evidence for Collapsing Boundaries and Urgency Signals in Perceptual Decision-Making. The Journal of Neuroscience, 35(6), 2476-2484.

Palestro, J. J., Weichart, E., Sederberg, P. B., & Turner, B. M. (2018). Some task demands induce collapsing bounds: Evidence from a behavioral analysis. Psychonomic Bulletin & Review, 25(4), 1225-1248.

Examples

# Probability density function
dWTM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.2, 0.5, -1.0, 0.0, 0.0, 1.0))

# Cumulative distribution function
pWTM(rt = c(1.2, 0.6, 0.4), resp = c("upper", "lower", "lower"),
     phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.2, 0.5, -1.0, 0.0, 0.0, 1.0))

# Random sampling
rWTM(n = 100, phi = c(0.3, 0.5, 1.0, 1.0, 1.5, 0.2, 0.5, -1.0, 0.0, 0.0, 1.0),
     dt = 0.0001)