The DDM Mechanism implements the “Drift Diffusion Model” (also know as the Diffusion Decision, Accumulation to Bound,
Linear Integrator, and Wiener Process First Passage Time Model [REFS]). This corresponds to a continuous version of
the sequential probability ratio test (SPRT [REF]), that is the statistically optimal procedure for two alternative
forced choice (TAFC) decision making ([REF]).
The DDM Mechanism may be constructed with a choice of several functions that fall into to general categories: analytic
solutions and path integration (see DDM Function Types below for more about these options.)
Creating a DDM Mechanism
A DDM Mechanism can be instantiated directly by calling its constructor, or by using the
mechanism command and
specifying DDM as its mech_spec argument. The model implementation is selected using the
argument. The function selection can be simply the name of a DDM function:
>>> import psyneulink as pnl
>>> my_DDM = pnl.DDM(function=pnl.BogaczEtAl)
or a call to the function with arguments specifying its parameters:
>>> my_DDM = pnl.DDM(function=pnl.BogaczEtAl(drift_rate=0.2, threshold=1.0))
The DDM Mechanism implements a general form of the decision process.
The input to the
function of a DDM Mechanism is always a scalar, irrespective of type of function that is used. Accordingly, the default InputState for a DDM takes a single scalar value as its input,
that represents the stimulus for the decision process. However, this can be configured using the input_format
argument of the DDM’s consructor, to accomodate use of the DDM with other Mechanisms that generate a stimulus array
(e.g., representing the stimuli associated with each of the two choices). By default, the input_format is
SCALAR. However, if it is specified as ARRAY, the DDM’s InputState is configured to accept a 1d 2-item vector,
and to use
Reduce as its Function, which subtract the 2nd element of the vector from the 1st, and provides this as
the input to the DDM’s
function. If ARRAY is specified, two Standard OutputStates are added to the DDM, that allow the result of the decision process to be represented
as an array corresponding to the stimulus array (see below).
The DDM Mechanism can generate two different types of results depending on which function is selected. When a
function representing an analytic solution is selected, the mechanism generates a single estimation for the process.
When the path integration function is selected, the mechanism carries out step-wise integration of the process; each
execution of the mechanism computes one step. (see DDM Function Types and Execution for additional details).
value of the DDM Mechanism may have up to six items. The first two of these are always assigned, and
are represented by the DDM Mechanism’s two default
output_states: DECISION_VARIABLE and RESPONSE_TIME. Other
output_states may be
automatically assigned, depending on the
function that has been assigned to the DDM, as shown in the
output_states assigned to a DDM can be customized by specifying a list of the desired DDM
Standard OutputStates in the output_states argument of its constructor, or the
OUTPUT_STATES entry of an OutputState specification dictionary. This can
include two additional Standard OutputStates for the DDM -
SELECTED_INPUT_ARRAY, that are available if the
ARRAY option is specified in its input_format argument (see Input). As with any Mechanism, customized
OutputStates can also be created and assigned.
DDM Function Types
The two Drift Diffusion Model Functions that calculate analytic solutions are BogaczEtAl
and NavarroAndFuss. When one of these functions is specified as the DDM Mechanism’s
function, the mechanism generates a single estimate of the outcome for the decision process (see
Execution for details).
In addition to DECISION_VARIABLE and RESPONSE_TIME, both Functions
return an accuracy value (represented in the PROBABILITY_UPPER_THRESHOLD
OutputState), and an error rate value (in the PROBABILITY_LOWER_THRESHOLD
OutputState; the NavarroAndFuss Function also returns expected values for mean correct response time
(RT_CORRECT_MEAN and variance of correct response times
Examples for each, that illustrate all of their parameters, are shown below:
>>> my_DDM_BogaczEtAl = pnl.DDM(
NavarroAndFuss Function (requires MATLAB engine):
>>> my_DDM_NavarroAndFuss = pnl.DDM(
The Drift Diffusion Model Function that calculates a path integration is DriftDiffusionIntegrator. The DDM Mechanism uses the Euler method to
carry out numerical step-wise integration of the decision process (see Execution below). In this
mode, only the DECISION_VARIABLE and RESPONSE_TIME are available.
>>> my_DDM_path_integrator = pnl.DDM(
When a DDM Mechanism is executed, it computes the decision process either analytically or by
numerical step-wise integration of its path. The method used is determined by its
function (see DDM Function Types). The DDM’s
function always returns values for the DECISION_VARIABLE and RESPONSE_TIME, and assigns these as the first two items of its
value attribute, irrespective of its function.
When an analytic function is selected, the same set of values is returned for every execution.
The returned values are determined entirely by the set of parameters passed to its
When the path integration, function is selected, a single step of integration is conducted each
time the Mechanism is executed. The returned values accumulate on every execution.
The analytic functions return a final positon and time of the model, along with other statistics, where as the path
integration function returns intermediate position and time values. The two types of functions can be thought of as
happening on different time scales: trial (analytic) and time step (path integration).