Modeling Experimental Data with (Time-Dependent) Diffusion Models
Basics and Application with dRiftDM (Edition 1)
2025-07-14
Welcome

This book introduces the use of diffusion models for analyzing experimental data, especially from conflict tasks like the Stroop, Flanker, or Simon tasks. We will start with the mathematical foundations of random walks and diffusion models, providing a solid base before diving into more advanced models with time-dependent parameters. Our goal is to equip readers with both the theoretical understanding and practical tools needed to describe and estimate these cognitive models.
Throughout the chapters, we will use the open-source language R and the R package dRiftDM to illustrate key ideas.
Disclaimer: (1) This is not just a “cookbook” of code recipes. Rather, we aim to provide the core concepts so that users can confidently apply diffusion models in their own work, using whichever tools or software they prefer. Additionally, many of the techniques introduced here are general and can be applied to many modeling situations. Thus, the content covered helps understanding cognitive modeling in general, and is not necessarily limited to diffusion models. (2) Especially in the beginning, we dive deeper into the mathematical foundations of diffusion models. Although this “deep-dive” is not necessary to apply diffusion models, and even requires some math, it will help to strengthen your conceptual understanding. We also hope that it provides a good starting point for you to further read on diffusion models and to connect your knowledge with other topics in mathematical psychology. (3) This is the very first time that we compiled all our material into one coherend text. Although we have read the book thoroughly by our own, there will certainly be mistakes or ambiguities. Should you find one (or even only believe that you found one), please let us know!
Requirements: Basic R programming skills and a general understanding of statistical concepts such as random variables and density functions.
License
This work, as a whole, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
The code contained in this book is simultaneously available under the MIT license.
Other books
We also learned from other books when compiling this material. Some of those sources, that we recommend readers for deepening their knowledge (and to read things in different words), are:
“Random Walk and Diffusion Models” by Wolf Schwarz, provides a detailed mathematical basis for random walks and diffusion models.
“New Handbook of Mathematical Psychology, Volume 2” provides an excellent chapter on the link between random walks and diffusion models written by Adele Diederich and Keivan Mallahi-Karai.
“Computational Modeling of Cognition and Behavior” by Simon Farrell and Stephan Lewandowsky covers the technical basics for estimating cognitive models (including the diffusion model) from an applied perspective.
