This function only creates the configuration object and does not run the
simulation. To actually execute the simulation, you must pass the returned
configuration object to run_simulation.
Supported Models:
This package supports three evidence accumulation models. The appropriate
backend is automatically selected based on the model parameter and
the parameters defined in your formulas.
- DDM (Drift Diffusion Model)
Models evidence accumulation towards a single upper threshold. Items
either reach the threshold and are recalled, or time out.
Required parameters (must appear in prior_formulas,
between_trial_formulas, or item_formulas):
A - Upper decision boundary/threshold
V - Drift rate (evidence accumulation rate)
Z - Starting point of evidence
ndt - Non-decision time
Set model = "ddm"
- RDM (Racing Diffusion Model)
Models multiple racing evidence accumulators, each with upper and lower
thresholds for binary decisions (correct/incorrect).
Required parameters:
A_upper - Upper decision boundary (correct response)
A_lower - Lower decision boundary (incorrect response)
V - Drift rate
Z - Starting point of evidence
ndt - Non-decision time
Set model = "rdm". Note: If you set model = "ddm" but
define A_upper instead of A, the model will automatically
switch to RDM.
- LCA (Leaky Competing Accumulator)
Models competitive evidence accumulation with leakage and mutual
inhibition between accumulators.
Required parameters:
A - Decision threshold
V - Input strength/drift rate
Z - Starting point of evidence
ndt - Non-decision time
beta - Self-excitation/leak parameter
k - Lateral inhibition strength
Set model = "lca"
- LFM (Lévy Flight Model)
Uses the same parameters as DDM. See DDM above.
Set model = "lfm"
- LBA (Linear Ballistic Accumulator)
Uses the same parameters as RDM. See RDM above.
Set model = "lba"
Note: All required parameters must be defined at least once across
prior_params, prior_formulas, between_trial_formulas, and
item_formulas.
Parameter Hierarchy and Formula Evaluation:
The simulation uses a hierarchical parameter system with sequential formula
evaluation, allowing later formulas to reference earlier ones:
prior_params - Initial constant values available to all formulas
prior_formulas - Evaluated once per condition, can reference
prior_params. Use for condition-level parameters that vary
across conditions.
between_trial_formulas - Evaluated once per trial within each
condition. Can reference both prior_params and variables from
prior_formulas. Use for trial-level variability.
item_formulas - Evaluated once per item within each trial.
Can reference all previous parameters. Use for item-specific parameters.
Using Distributions:
You can use the distributional package to define random parameters.
For example:
A ~ distributional::dist_uniform(0.5, 2.0) - Uniform distribution
V_condition ~ distributional::dist_normal(1.0, 0.2) - Normal distribution
sigma ~ 0.5 - Constant value
V ~ distributional::dist_normal(V_condition, sigma) - Reference earlier parameters
Each formula is evaluated sequentially, so you can build complex parameter
dependencies. For instance, you might define a base drift rate V in
prior_formulas, then add trial-level noise in
between_trial_formulas, and finally scale by item position in
item_formulas.