Skip to main content

HDDM is a python module that implements Hierarchical Bayesian estimation of Drift Diffusion Models.

Project description

Author:

Thomas V. Wiecki, Imri Sofer, Michael J. Frank

Contact:
thomas_wiecki@brown.edu, imri_sofer@brown.edu, michael_frank@brown.edu
Web site:

http://ski.clps.brown.edu/hddm_docs

Github:

http://github.com/hddm-devs/hddm

Mailing list:

https://groups.google.com/group/hddm-users/

License:

HDDM is released under the BSD 2 license.

Version:
0.5.5
https://secure.travis-ci.org/hddm-devs/hddm.png?branch=develop

Purpose

HDDM is a python toolbox for hierarchical Bayesian parameter estimation of the Drift Diffusion Model (via PyMC). Drift Diffusion Models are used widely in psychology and cognitive neuroscience to study decision making.

Features

  • Uses hierarchical Bayesian estimation (via PyMC) of DDM parameters to allow simultaneous estimation of subject and group parameters, where individual subjects are assumed to be drawn from a group distribution. HDDM should thus produce better estimates when less RT values are measured compared to other methods using maximum likelihood for individual subjects (i.e. DMAT or fast-dm).

  • Heavily optimized likelihood functions for speed (Navarro & Fuss, 2009).

  • Flexible creation of complex models tailored to specific hypotheses (e.g. estimation of separate drift-rates for different task conditions; or predicted changes in model parameters as a function of other indicators like brain activity).

  • Estimate trial-by-trial correlations between a brain measure (e.g. fMRI BOLD) and a diffusion model parameter using the HDDMRegression model.

  • Built-in Bayesian hypothesis testing and several convergence and goodness-of-fit diagnostics.

Quick-start

The following is a minimal python script to load data, run a model and examine its parameters and fit.

import hddm

# Load data from csv file into a NumPy structured array
data = hddm.load_csv('simple_difficulty.csv')

# Create a HDDM model multi object
model = hddm.HDDM(data, depends_on={'v':'difficulty'})

# Create model and start MCMC sampling
model.sample(2000, burn=20)

# Print fitted parameters and other model statistics
model.print_stats()

# Plot posterior distributions and theoretical RT distributions
model.plot_posteriors()
model.plot_posterior_predictive()

For more information about the software and theories behind it, please see the main publication.

Installation

The easiest way to install HDDM is through Anaconda (available for Windows, Linux and OSX):

  1. Download and install Anaconda.

  2. In a shell (Windows: Go to Start->Programs->Anaconda->Anaconda command prompt) type:

conda install -c pymc pymc
conda install -c twiecki hddm

If you want to use pip instead of conda, type:

pip install pandas
pip install pymc
pip install kabuki
pip install hddm

This might require super-user rights via sudo. Note that this installation method is discouraged as it leads to all kinds of problems on various platforms.

If you are having installation problems please contact the mailing list.

How to cite

If HDDM was used in your research, please cite the publication:

Wiecki TV, Sofer I and Frank MJ (2013). HDDM: Hierarchical Bayesian estimation of the Drift-Diffusion Model in Python. Front. Neuroinform. 7:14. doi: 10.3389/fninf.2013.00014

Published papers using HDDM

  • Cavanagh, J. F., Wiecki, T. V, Cohen, M. X., Figueroa, C. M., Samanta, J., Sherman, S. J., & Frank, M. J. (2011). Subthalamic nucleus stimulation reverses mediofrontal influence over decision threshold. Nature Neuroscience, 14(11), 1462–7. doi:10.1038/nn.2925

  • Jahfari, S., Ridderinkhof, K. R., & Scholte, H. S. (2013). Spatial frequency information modulates response inhibition and decision-making processes. PloS One, 8(10), e76467. doi:10.1371/journal.pone.0076467

  • Zhang, J., & Rowe, J. B. (2014). Dissociable mechanisms of speed-accuracy tradeoff during visual perceptual learning are revealed by a hierarchical drift-diffusion model. Frontiers in Neuroscience, 8, 69. doi:10.3389/fnins.2014.00069

  • Cavanagh, J. F., Wiecki, T. V, Kochar, A., & Frank, M. J. (2014). Eye Tracking and Pupillometry Are Indicators of Dissociable Latent Decision Processes. Journal of Experimental Psychology. General. doi:10.1037/a0035813

  • Dunovan, K. E., Tremel, J. J., & Wheeler, M. E. (2014). Prior probability and feature predictability interactively bias perceptual decisions. Neuropsychologia. doi:10.1016/j.neuropsychologia.2014.06.024

  • Michmizos, K. P., & Krebs, H. I. (2014). Reaction time in ankle movements: a diffusion model analysis. Experimental Brain Research. doi:10.1007/s00221-014-4032-8

Getting started

Check out the tutorial on how to get started. Further information can be found in howto and the documentation.

Join our low-traffic mailing list.

Project details


Download files

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

Source Distribution

HDDM-0.5.5.tar.gz (1.3 MB view details)

Uploaded Source

File details

Details for the file HDDM-0.5.5.tar.gz.

File metadata

  • Download URL: HDDM-0.5.5.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for HDDM-0.5.5.tar.gz
Algorithm Hash digest
SHA256 ab79ce8cc0bb616d2f9be187e7eb0f1aca38548f5905b6232800c6bc18a10957
MD5 3a286c6f65279da22f595f8408b4f271
BLAKE2b-256 75bc362ed48bb6ec6db4b9972cf40dce1167163a7226b978c2c7167e1477cfd6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page