# Is there an R implementation of the linear ballistic accumulator model or Ratcliff's diffusion model for measuring response time and accuracy?

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

-

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

### LBA

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).

### References

• 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
-
There is also the glba package for R: cran.r-project.org/web/packages/glba/glba.pdf –  crash May 13 at 17:28
@crash thanks I've added it to the answer. –  Jeromy Anglim May 14 at 0:13

The R package diffIRT (http://www.dylanmolenaar.nl/jss1265.pdf) 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 http://raoul.socsci.uva.nl/EZ2/.

-

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]

-