An R package for hierarchical Bayesian modeling of RLDM tasks.
Clone or download

README.md

hBayesDM

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status CRAN Latest Release Downloads

hBayesDM (hierarchical Bayesian modeling of Decision-Making tasks) is a user-friendly R package that offers hierarchical Bayesian analysis of various computational models on an array of decision-making tasks. hBayesDM uses Stan for Bayesian inference.

Getting Started

Prerequisite

To install hBayesDM, RStan should be properly installed before you proceed. For detailed instructions, please go to this link: https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started

For the moment, RStan requires you to specify that the C++14 standard should be used to compile Stan programs (based on this link):

Sys.setenv(USE_CXX14 = 1)
library("rstan") # observe startup messages

Installation

hBayesDM can be installed from CRAN by running the following command in R:

install.packages('hBayesDM')  # Install hBayesDM from CRAN

We strongly recommend users to install hBayesDM from GitHub. All models in this GitHub version are precompiled, which saves time for compiling Stan models. However, it may cause some memory allocation issues on a Windows machine.

You can install the latest version from GitHub with:

# `devtools` is required to install hBayesDM from GitHub
if (!require(devtools)) install.packages("devtools")
devtools::install_github("CCS-Lab/hBayesDM")

Quick Links

Citation

If you used hBayesDM or some of its codes for your research, please cite this paper:

Ahn, W.-Y., Haines, N., & Zhang, L. (2017). Revealing neuro-computational mechanisms of reinforcement learning and decision-making with the hBayesDM package. Computational Psychiatry, 1, 24-57. https://doi.org/10.1162/CPSY_a_00002.

or for BibTeX:

@article{hBayesDM,
  title = {Revealing Neurocomputational Mechanisms of Reinforcement Learning and Decision-Making With the {hBayesDM} Package},
  author = {Ahn, Woo-Young and Haines, Nathaniel and Zhang, Lei},
  journal = {Computational Psychiatry},
  year = {2017},
  volume = {1},
  pages = {24--57},
  publisher = {MIT Press},
  url = {https://doi.org/10.1162/CPSY_a_00002},
}