Package: dRiftDM 0.2.2

dRiftDM: Estimating (Time-Dependent) Drift Diffusion Models
Fit and explore Drift Diffusion Models (DDMs), a common tool in psychology for describing decision processes in simple tasks. It can handle both time-independent and time-dependent DDMs. You either choose prebuilt models or create your own, and the package takes care of model predictions and parameter estimation. Model predictions are derived via the numerical solutions provided by Richter, Ulrich, and Janczyk (2023, <doi:10.1016/j.jmp.2023.102756>).
Authors:
dRiftDM_0.2.2.tar.gz
dRiftDM_0.2.2.tar.gz(r-4.5-noble)dRiftDM_0.2.2.tar.gz(r-4.4-noble)
dRiftDM_0.2.2.tgz(r-4.4-emscripten)dRiftDM_0.2.2.tgz(r-4.3-emscripten)
dRiftDM.pdf |dRiftDM.html✨
dRiftDM/json (API)
NEWS
# Install 'dRiftDM' in R: |
install.packages('dRiftDM', repos = 'https://cloud.r-project.org') |
Bug tracker:https://github.com/bucky2177/driftdm/issues1 issues
Pkgdown site:https://bucky2177.github.io
- dmc_synth_data - A synthetic data set with two conditions
- ratcliff_synth_data - A synthetic data set with one condition
- ulrich_flanker_data - Exemplary Flanker Data
- ulrich_simon_data - Exemplary Simon Data
Last updated 26 days agofrom:2e2d9b14b4. Checks:3 OK. Indexed: no.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 04 2025 |
R-4.5-linux-x86_64 | OK | Mar 04 2025 |
R-4.4-linux-x86_64 | OK | Mar 04 2025 |
Exports:b_codingb_coding<-calc_statscoef<-comp_funscomp_funs<-component_shelfcondsconds<-ddm_optsddm_opts<-dmc_dmdrift_dmestimate_modelestimate_model_idsflex_prmsflex_prms<-get_example_fits_idsload_fits_idsmodify_flex_prmsobs_dataobs_data<-pdfsprms_solveprms_solve<-ratcliff_dmre_evaluate_modelsimulate_datasimulate_tracessimulate_valuessolversolver<-ssp_dmunpack_objunpack_traces
Dependencies:clicrayonDEoptimdfoptimgluehmslifecyclepkgconfigprettyunitsprogressR6rbibutilsRcppRdpackrlangvctrswithr
How to Convert DMC's parameters
Rendered fromconvert_dmc_parameters.Rmd
usingknitr::rmarkdown
on Mar 04 2025.Last update: 2025-03-04
Started: 2025-03-04
How To Customize DDMs
Rendered fromcustomize_ddms.Rmd
usingknitr::rmarkdown
on Mar 04 2025.Last update: 2025-03-04
Started: 2025-03-04
Introduction to dRiftDM
Rendered fromdRiftDM.Rmd
usingknitr::rmarkdown
on Mar 04 2025.Last update: 2025-03-04
Started: 2025-03-04
Citation
Koob V, Richter T, Janczyk M (2024). dRiftDM: An R package for fitting non-stationary drift diffusion models. R package version 0.2.1.
Corresponding BibTeX entry:
@Manual{, title = {dRiftDM: An R package for fitting non-stationary drift diffusion models}, author = {Valentin Koob and Thomas Richter and Markus Janczyk}, year = {2024}, note = {R package version 0.2.1}, }
Readme and manuals
dRiftDM

The package dRiftDM was developed to assist psychology researchers in applying and fitting diffusion models to empirical data within the R environment. Its most important feature is the ability to handle non-stationary problems, specifically diffusion models with time-dependent parameters. The package includes essential tools for standard analyses, such as building models, estimating parameters for multiple participants (individually for each participant), and creating summary statistics. The pre-built models available in the package are:
- The Standard (Ratcliff) Diffusion Model (Ratcliff, 1978, Psychological Review)
- The Diffusion Model for Conflict Tasks (Ulrich et al., 2015, Cognitive Psychology)
- The Shrinking Spotlight Model (White et al., 2011, Cognitive Psychology)
Users can flexibly create custom models and utilize the dRiftDM machinery for estimating them.
Starting with version 0.2.0, model predictions (i.e., first-passage times) are derived by numerically solving the Kolmogorov-Forward Equation or a coupled set of integral equations, based on code provided by Richter et al. (2023, Journal of Mathematical Psychology).
Notes
Compared to the previous version 0.1.1, versions >0.2.0 make greater use of the S3 object system. Additionally, beginning with version 0.2.0, models use “flex_prms” objects to handle parameters across conditions.
To install the older version (0.1.1), you can use:
devtools::install_github("bucky2177/dRiftDM", ref = "0.1.1")
Installation
You can install the development version of dRiftDM from GitHub with:
# install.packages("devtools")
devtools::install_github("bucky2177/dRiftDM")
The CRAN version can be installed with:
install.packages("dRiftDM")
How to use dRiftDM
If you are interested in getting started with dRiftDM, we recommend reading the OSF pre-print. More information on functions and model customization can be found in dRiftDM’s vignettes. These vignettes are also available from the “Getting started” and “Articles” tabs on our Github.io page.
If you have any questions, feel free to contact us!
Help Manual
Help page | Topics |
---|---|
The Coding of the Boundaries | b_coding b_coding.drift_dm b_coding.fits_ids_dm b_coding<- b_coding<-.drift_dm |
Calculate Statistics | calc_stats calc_stats.data.frame calc_stats.drift_dm calc_stats.fits_ids_dm print.stats_dm print.stats_dm_list |
Access Coefficients of a Model | coef.drift_dm coef.fits_ids_dm coef<- coef<-.drift_dm print.coefs_dm |
The Component Functions of A Model | comp_funs comp_funs.drift_dm comp_funs.fits_ids_dm comp_funs<- comp_funs<-.drift_dm |
Diffusion Model Components | component_shelf |
The Conditions of an Object | conds conds.data.frame conds.drift_dm conds.fits_ids_dm conds.traces_dm_list conds<- conds<-.drift_dm |
Optional Arguments for the Component Functions | ddm_opts ddm_opts.drift_dm ddm_opts<- ddm_opts<-.drift_dm |
Create the Diffusion Model for Conflict Tasks | dmc_dm |
A synthetic data set with two conditions | dmc_synth_data |
Create a drift_dm object | drift_dm print.drift_dm |
Estimate the Parameters of a drift_dm Model | estimate_model |
Fit Multiple Individuals and Save Results | estimate_model_ids |
Flex_Prms | flex_prms flex_prms.drift_dm flex_prms.flex_prms flex_prms.numeric flex_prms<- flex_prms<-.drift_dm print.flex_prms |
Auxiliary Function to create a fits_ids object | get_example_fits_ids |
Plot Parameter Distribution(s) | hist.coefs_dm |
Load Estimates of a Fit Procedure | load_fits_ids print.fits_ids_dm |
Extract Log-Likelihood for a drift_dm Object | logLik.drift_dm |
Extract Model Statistics for fits_ids_dm Object | AIC.fits_ids_dm BIC.fits_ids_dm logLik.fits_ids_dm |
Set Instructions to a flex_prms object | modify_flex_prms modify_flex_prms.drift_dm modify_flex_prms.flex_prms |
Get the Number of Observations for a drift_dm Object | nobs.drift_dm |
The Observed Data | obs_data obs_data.drift_dm obs_data.fits_ids_dm obs_data<- obs_data<-.drift_dm |
Access the Probability Density Functions of a Model | pdfs pdfs.drift_dm |
Plot Conditional Accuracy Functions (CAFs) | plot.cafs |
Plot Delta Functions | plot.delta_funs |
Plot Components of a Drift Diffusion Model | plot.drift_dm |
Plot Quantiles | plot.quantiles |
Plot Multiple Statistics | plot.stats_dm_list |
Plot Traces of a Drift Diffusion Model | plot.traces_dm plot.traces_dm_list |
Summary and Printing for fits_ids_dm Objects | print.summary.fits_ids_dm summary.fits_ids_dm |
The Parameters for Deriving Model Predictions | prms_solve prms_solve.drift_dm prms_solve.fits_ids_dm prms_solve<- prms_solve<-.drift_dm |
Create a Basic Diffusion Model | ratcliff_dm |
A synthetic data set with one condition | ratcliff_synth_data |
Re-evaluate the model | re_evaluate_model |
Simulate Synthetic Responses | simulate_data simulate_data.drift_dm |
Simulate Trajectories/Traces of a Model | print.traces_dm print.traces_dm_list simulate_traces simulate_traces.drift_dm simulate_traces.fits_ids_dm |
Simulate Traces for One Conditions | simulate_traces_one_cond |
Simulate Values | simulate_values |
The Solver for Deriving Model Predictions | solver solver.drift_dm solver.fits_ids_dm solver<- solver<-.drift_dm |
Create the Shrinking Spotlight Model | ssp_dm |
Summary for 'coefs_dm' Objects | print.summary.coefs_dm summary.coefs_dm |
Summary for 'drift_dm' Objects | print.summary.drift_dm summary.drift_dm |
Summarizing Flex Parameters | print.summary.flex_prms summary.flex_prms |
Summary for 'stats_dm' Objects | print.summary.cafs print.summary.delta_funs print.summary.fit_stats print.summary.quantiles print.summary.stats_dm print.summary.stats_dm_list print.summary.sum_dist summary.cafs summary.delta_funs summary.fit_stats summary.quantiles summary.stats_dm summary.stats_dm_list summary.sum_dist |
Summary for traces_dm and traces_dm_list Objects | print.summary.traces_dm print.summary.traces_dm_list summary.traces_dm summary.traces_dm_list |
Exemplary Flanker Data | ulrich_flanker_data |
Exemplary Simon Data | ulrich_simon_data |
Unpack/Destroy dRiftDM Objects | unpack_obj unpack_obj.coefs_dm unpack_obj.stats_dm unpack_obj.stats_dm_list unpack_obj.traces_dm unpack_obj.traces_dm_list |
Unpack/Destroy Traces Objects | unpack_traces unpack_traces.traces_dm unpack_traces.traces_dm_list |