plot.drift_dm | R Documentation |
This function generates plots for all components of a drift diffusion model (DDM), such as drift rate, boundary, and starting condition. Each component is plotted against the time or evidence space, allowing for visual inspection of the model's behavior across different conditions.
## S3 method for class 'drift_dm'
plot(
x,
...,
conds = NULL,
col = NULL,
xlim = NULL,
legend = NULL,
legend_pos = "topright",
mfrow = NULL
)
x |
an object of class drift_dm |
... |
additional arguments passed forward. |
conds |
character vector, specifying conditions to plot. Defaults to all
conditions in |
col |
character vector, specifying colors for each condition. If a single color is provided, it will be repeated for each condition. |
xlim |
numeric vector of length 2, specifying the x-axis limits for components related to the time space. |
legend |
character vector, specifying legend labels corresponding to the conditions. |
legend_pos |
character, specifying the position of the legend on the
plot (e.g., |
mfrow |
an optional numeric vector of length 2, specifying the number of
rows and columns for arranging multiple panels in a single plot. If |
The plot.drift_dm
function provides an overview of key DDM components,
which include:
mu_fun
: Drift rate over time.
mu_int_fun
: Integrated drift rate over time.
x_fun
: Starting condition as a density across evidence values.
b_fun
: Boundary values over time.
dt_b_fun
: Derivative of the boundary function over time.
nt_fun
: Non-decision time as a density over time.
For each component, if multiple conditions are specified, they will be
plotted using different colors as specified in color
.
When the evaluation of a model component fails, the respective component will not be plotted, but no warning is thrown.
Nothing (NULL
; invisibly)
# plot the component functions of the Ratcliff DDM
plot(ratcliff_dm())
plot(ratcliff_dm(var_non_dec = TRUE))
# Note: the variability in the drift rate for the Ratcliff DDM
# is not plotted! This is because it is not actually stored as a component
# function.
# plot the component functions of the DMC model
plot(dmc_dm(), col = c("green", "red"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.