Cognitive Sciences Stack Exchange is a question and answer site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for an implementation of the linear ballistic accumulator model or Ratcliff's diffusion model (e.g. in R, MATLAB, or Python).

share|improve this question
up vote 15 down vote accepted

Here are a few options. I have not tried them yet personally.


Scott Brown has a copy of Donkin et al (2009) on his web page with some code in R, Excel, and WinBUGS for fitting the LBA model:

There's also the glba package on CRAN by Ingmar Visser.

Diffusion model

The Diffussion model is available as a matlab toolbox called (DMAT).


  • Donkin, C., Averell, L., Brown, S.D., & Heathcote, A. (2009) Getting more from accuracy and response time data: Methods for fitting the Linear Ballistic Accumulator model. Behavior Research Methods, 41, 1095-1110. PDF
  • Vandekerckhove, J., & Tuerlinckx, F. (2008). Diffusion model analysis with MATLAB: A DMAT primer. Behavior Research Methods, 40, 61-72. doi:10.3758/BRM.40.1.61 PDF
share|improve this answer
There is also the glba package for R: – crash May 13 '15 at 17:28
@crash thanks I've added it to the answer. – Jeromy Anglim May 14 '15 at 0:13

For the diffusion model, there is also Eric-Jan Wagenmakers' "EZ-diffusion model", which you can find here.

This paper compares three different pieces of software for estimation of diffusion model parameters:

von Ravenzwaaij D., & Oberauer, K. (2009). How to use the diffusion model: Parameter recovery of three methods: EZ, fast-dm, and DMAT. Journal of Mathematical Psychology, 53 (6), 463–473. [PDF]

share|improve this answer

The R package diffIRT ( estimates both the Q and the D diffusion models (see his website for the van der Maas et al. paper discussing the differences between these models). R code for the EZ2 approach, which is much faster if that is important for your applications, is

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.