Skip to contents

This function creates a drift_dm model that corresponds to the basic Ratcliff Diffusion Model

Usage

ratcliff_dm(
  var_non_dec = FALSE,
  var_start = FALSE,
  var_drift = FALSE,
  instr = NULL,
  obs_data = NULL,
  sigma = 1,
  t_max = 3,
  dt = 0.001,
  dx = 0.001,
  solver = "kfe",
  b_coding = NULL
)

Arguments

var_non_dec, var_start, var_drift

logical, indicating whether the model should have a (uniform) variable non-decision time, starting point, or (normally-distributed) variable drift rate. (see also nt_uniform and x_uniform in component_shelf)

instr

optional string with "instructions", see modify_flex_prms().

obs_data

data.frame, an optional data.frame with the observed data. See obs_data.

sigma, t_max, dt, dx

numeric, providing the settings for the diffusion constant and discretization (see drift_dm)

solver

character, specifying the solver.

b_coding

list, an optional list with the boundary encoding (see b_coding)

Value

An object of type drift_dm (parent class) and ratcliff_dm (child class), created by the function drift_dm().

Details

The classical Ratcliff Diffusion Model is a diffusion model with a constant drift rate muc and a constant boundary b. If var_non_dec = FALSE, a constant non-decision time non_dec is assumed, otherwise a uniform non-decision time with mean non_dec and range range_non_dec. If var_start = FALSE, a constant starting point centered between the boundaries is assumed (i.e., a dirac delta over 0), otherwise a uniform starting point with mean 0 and range range_start. If var_drift = FALSE, a constant drift rate is assumed, otherwise a normally distributed drift rate with mean mu_c and standard deviation sd_muc (can be computationally intensive). Important: Variable drift rate is only possible with dRiftDM's mu_constant function. No custom drift rate is yet possible in this case.

Examples

# the model with default settings
my_model <- ratcliff_dm()

# the model with a variable non-decision time and with a more coarse
# discretization
my_model <- ratcliff_dm(
  var_non_dec = TRUE,
  t_max = 1.5,
  dx = .005,
  dt = .005
)