HDDM is a Python package that makes it extremely easy to perform Drift Diffusion Model analyses using hierarchical Bayesian parameter estimation. As Python packages go, it is fairly well-documented, and has an active user forum where you can ask questions and get answers (often from the software developers themselves) within 48 hours.
This guide is not written to be comprehensive, nor will it teach you the fundamentals of DDM or use of HDDM. Instead, this guide goes over some of the finer points of HDDM that would probably take you a long time to figure out on your own, especially if you're a newcomer to DDM, Python, or Bayesian stats.
Click here to see sample scripts for HDDM.
Good for you! Here are some resources that will get you started:
Anaconda is an open-data package manager that contains many Python packages useful for scientific computing. Here's how to install it on your personal computer:
Unfortunately, some of the packages that HDDM relies on are not yet compatible with Python 3.6. To proceed, you have two options:
HDDM's documentation includes an excellent tutorial, which you should treat as a textbook.
Use my sample scripts as a template!
There are miscellaneous coding quirks with HDDM, Jupyter, and Oscar that can make you want to throw your computer out the window, especially because these quirks are not particularly well-documented. I have done all the hard work for you figuring out how to fix/work around these quirks... don't reinvent the wheel! Reference my sample scripts to see how to bypass some common problems.
Note that HDDM is utterly inflexible about what you name your key variable columns:
Jupyter is a Python package that allows you to create "notebooks" containing Python code. It is automatically installed when you install Anaconda. The real benefit of using Jupyter is that you can write modular code (it's literally compartmentalized into separate cells), which makes it extremely easy to play around with code. Therefore, Jupyter is great for when you need to immediately see the output of experimental code.
Note that Jupyter is less good for when you need to run computationally-intensive analyses that you've already bug-tested. In these situations, you should use CCV's Oscar to run batch scripts instead.
Type jupyter notebook into your Terminal. A new tab will open in your default web browser, from which you can navigate through your computer's folders and create new notebooks wherever you please. If your web browser does not open a new tab automatically, copy the link from your Terminal and paste it into your browser. Don't close Terminal unless you want to close Jupyter!
Oscar is the name of Brown's computing cluster, maintained through the Center for Computation and Visualization (CCV). You should use Oscar when you have a thoroughly-vetted analysis script that would take your personal/work computer a long time to process (e.g. MCMC sampling ≥ 2000).
Click here for instructions on how to create an Oscar account. By default, you have free access to an "exploratory" account as an individual. However, our lab has access to a "condo" account through the Brown Institute for Brain Science (BIBS), which means that you will have priority access to truly mind-boggling computing power once you are associated with our group.
Open up Terminal, then type ssh YourUsername@ssh.ccv.brown.edu. Type in your password, and you'll be logged into a login node.
Genuinely good question. Okay, imagine walking into a mansion. That mansion is the entirety of Oscar. You get to rent rooms inside this mansion: from the shared resources, you're given "private" computing resources to do whatever you want, and you can specify how much computing power you need.
On the other hand, the front door and foyer of this mansion are like a login node: everyone shares it. What you do in the privacy of your own room is your own business, but it would be very inconsiderate if you were to start doing a weird interpretive dance in the middle of a common space, as you'd be taking up a lot of unnecessary space from everyone else for no good reason. In the same way, you should NEVER run scripts straight from the login node. Why? Because login nodes are shared by everyone, and because login nodes aren't very computationally powerful anyways. It's self-defeating and it pisses people off. What should you do instead? Most likely, you'll want to run an interactive session or a batch job.
First, you'll need to get the installer on the CCV server. To do this, download Anaconda for Linux (64-bit, x86). Upload that shell script you just downloaded to your Oscar data folder (/gpfs/data/groupname/username). If you don't know how to do this, reference "Moving files around on Oscar" below.
Presuming that you're already logged into your CCV account, start an interactive session. Recommended parameters are interact -n 16 -t 01:00:00 -m 16g
Finally, run whatever command Anaconda's website tells you to (something like bash Anaconda3-VersionNumber-Linux-x86_64.sh).
Next, follow the instructions in the "How to install HDDM" section of this page WITH THE FOLLOWING ADDENDUMS:
There are ways to do this using Terminal text commands, but I personally like using a GUI. Honestly, if you need to ask, you'd probably prefer using a GUI also.
Download the FileZilla client and install it. Open up the "Site Manager" window, and create a new site. Name it "CCV" or something to that effect. For "host", copy/paste ssh.ccv.brown.edu. Select the SFTP protocol. Select the Normal login type, then type in your username and password into the appropriate fields. Finally, click connect to connect with the CCV server.
By default, you will be taken to your "home" directory. You should never use it. Instead, store all of your data in your data directory, preferably such that each HDDM project is stored in its own subdirectory.
Read this guide from CCV to get a Gestalt sense for what to do. Don't worry if you don't understand everything they say. Download my sample scripts to see how batch scripts should be written.
This guide was written by Jae-Young Son and was last updated July 11th, 2017