Skip to main content

A toolbox for data analysis using the attentional drift-diffusion model.

Project description

This toolbox can be used to perform model fitting and to generate simulations for the attentional drift-diffusion model (aDDM), as well as for the classic version of the drift-diffusion model (DDM) without an attentional component.


aDDM-Toolbox supports Python 2.7 (and Python 3.6 tentatively – please report any bugs). The following libraries are required: * deap * matplotlib * numpy * pandas * scipy


$ pip install addm_toolbox

Running tests

To make sure everything is working correctly after installation, try (from a UNIX shell, not the Python interpreter):

$ addm_run_tests

This should take a while to finish, so maybe go get a cup of tea :)

Getting started

To get a feel for how the algorithm works, try:

$ addm_demo --display-figures

You can see all the arguments available for the demo using:

$ addm_demo --help

Here is a list of useful scripts which can be similarly run from a UNIX shell: * addm_demo * ddm_pta_test * addm_pta_test * addm_pta_mle * addm_pta_map * addm_simulate_true_distributions * addm_basinhopping * addm_genetic_algorithm * ddm_mla_test * addm_mla_test

You can also have a look directly at the code in the following modules: * contains the aDDM implementation, with functions to generate model simulations and obtain the likelihood for a given data trial. * is equivalent to but for the DDM. * generates an artificial data set for a given set of aDDM parameters and attempts to recover these parameters through maximum a posteriori estimation. * is equivalent to but for the DDM. * fits the aDDM to a data set by performing maximum likelihood estimation. * performs model comparison for the aDDM by obtaining a posterior distribution over a set of models. * generates aDDM simulations using empirical data for the fixations.

Common issues

If you have issues using the toolbox under Python 3, try it with Python 2.7 instead, which should be more stable.

If you get a Python RuntimeError with the message “Python is not installed as a framework.”, try creating the file ~/.matplotlib/matplotlibrc and adding the following code:

backend: TkAgg

If you get an error of the type “pkg_resources.VersionConflict”, try updating the package through pip:

sudo pip install --upgrade addm_toolbox



This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the COPYING file for details.


This toolbox was developed as part of a research project in the Rangel Neuroeconomics Lab at the California Institute of Technology.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for addm-toolbox, version 0.1.9
Filename, size File type Python version Upload date Hashes
Filename, size addm_toolbox-0.1.9.tar.gz (1.0 MB) File type Source Python version None Upload date Hashes View
Filename, size addm_toolbox-0.1.9-py2-none-any.whl (1.0 MB) File type Wheel Python version py2 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page