Saturday, January 22, 2022

Installing and running HDDM in python

 Installing and using HDDM

(Mostly from here : with modifications as on Jan 22, 2022.)

I use anaconda for my package management. So the steps will be for a conda installation of python.

  1. install anaconda for windows 64bit
  2. install the build tools for visual basic (here  - go all the way down and install the build tools. Everything else will just take up too much space)
in Anaconda prompt: 
  1. conda create -n hddmEnv python=3.6.10
  2. conda activate hddmEnv
  3. conda install pandas patsy
The other blog says to downgrade pandas to version 0.20.0, but statsmodels no longer supports that version of pandas. I am just using the latest version and seeing if it  fails somewhere.

EDIT: the hddm code uses the old pandas method of updating rows (uses df.ix instead of df.loc). I have updated pandas to 0.21.0 (the lowest version required by statsmodels) and it works (as in I can run the Go/No-go tutorial on the official HDDM site).
  1. pip install pandas==0.21.0
  2. conda install pymc=2.3.7
  3. conda install -c anaconda statmodels
  4. pip install kabuki
  5. pip install cython 
  6. pip install HDDM==0.7.3
Then go to anaconda navigator, click on the dropdown below and you should see your new environment.

Select the new environment you created (hddmEnv) and install whatever IDE you are comfortable with.

This solution works as of Jan 22, 2022.


 


No comments: