Learn R Programming

hBayesDM (version 2.0.1)

Hierarchical Bayesian Modeling of Decision-Making Tasks

Description

Fit an array of decision-making tasks with computational models in a hierarchical Bayesian framework. Can perform hierarchical Bayesian analysis of various computational models with a single line of coding (Ahn et al., 2017) .

Copy Link

Version

Install

install.packages('hBayesDM')

Monthly Downloads

675

Version

2.0.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Woo-Young Ahn

Last Published

September 9th, 2026

Functions in hBayesDM (2.0.1)

bandit4arm2_kalman_filter

Kalman Filter
bandit4arm_lapse

5 Parameter Model, without C (choice perseveration) but with xi (noise)
bandit4arm_4par

4 Parameter Model, without C (choice perseveration)
bandit4arm_2par_lapse

3 Parameter Model, without C (choice perseveration), R (reward sensitivity), and P (punishment sensitivity). But with xi (noise)
banditNarm_2par_lapse

3 Parameter Model, without C (choice perseveration), R (reward sensitivity), and P (punishment sensitivity). But with xi (noise)
alt_delta

Rescorla-Wagner (Delta) Model
bandit4arm_singleA_lapse

4 Parameter Model, without C (choice perseveration) but with xi (noise). Single learning rate both for R and P.
alt_gamma

Rescorla-Wagner (Gamma) Model
bandit4arm_lapse_decay

5 Parameter Model, without C (choice perseveration) but with xi (noise). Added decay rate (Niv et al., 2015, J. Neuro).
bandit2arm_delta

Rescorla-Wagner (Delta) Model
cgt_cm

Cumulative Model
banditNarm_kalman_filter

Kalman Filter
bart_par4

Re-parameterized version of BART model with 4 parameters
banditNarm_singleA_lapse

4 Parameter Model, without C (choice perseveration) but with xi (noise). Single learning rate both for R and P.
bart_ewmv

Exponential-Weight Mean-Variance Model
banditNarm_lapse

5 Parameter Model, without C (choice perseveration) but with xi (noise)
banditNarm_lapse_decay

5 Parameter Model, without C (choice perseveration) but with xi (noise). Added decay rate (Niv et al., 2015, J. Neuro).
banditNarm_delta

Rescorla-Wagner (Delta) Model
choiceRT_ddm

Drift Diffusion Model
banditNarm_4par

4 Parameter Model, without C (choice perseveration)
dd_cs_single

Constant-Sensitivity (CS) Model
dd_exp

Exponential Model
choiceRT_lba

Choice Reaction Time task, linear ballistic accumulator modeling
cra_linear

Linear Subjective Value Model
dd_hyperbolic

Hyperbolic Model
choiceRT_ddm_single

Drift Diffusion Model
dbdm_prob_weight

Probability Weight Function
cra_exp

Exponential Subjective Value Model
dd_cs

Constant-Sensitivity (CS) Model
choiceRT_lba_single

Choice Reaction Time task, linear ballistic accumulator modeling
extract_ic

Extract Model Comparison Estimates
gng_m2

RW + noise + bias
estimate_mode

Function to estimate mode of MCMC samples
.hbayesdm_stan_file

Locate the .stan file for a given hBayesDM model name.
dd_hyperbolic_single

Hyperbolic Model
gng_m1

RW + noise
.hbayesdm_resolve_inits

Resolve the `inits` argument into the format cmdstanr expects.
.hbayesdm_fit

Fit an hBayesDM Stan model via cmdstanr.
.hbayesdm_extract

Extract draws for the requested parameters from a cmdstanr fit.
.hbayesdm_compile

Load (and compile if necessary) a CmdStanModel for an hBayesDM model.
hBayesDM-package

Hierarchical Bayesian Modeling of Decision-Making Tasks
hdi

Compute Highest-Density Interval
gng_m4

RW (rew/pun) + noise + bias + pi
gng_m3

RW + noise + bias + pi
igt_pvl_decay

Prospect Valence Learning (PVL) Decay-RI
igt_orl

Outcome-Representation Learning Model
hgf_ibrb_single

Individual-level Bayesian version of the Hierarchical Gaussian Filter model for binary inputs and binary responses
hgf_ibrb

Hierarchical Bayesian version of the Hierarchical Gaussian Filter model for binary inputs and binary responses
hBayesDM_model

hBayesDM Model Base Function
hbayesdm-cmdstan

Internal helpers for fitting hBayesDM Stan models via cmdstanr.
plot_hdi

Plots highest density interval (HDI) from (MCMC) samples and prints HDI in the R console. HDI is indicated by a red line. Based on John Kruschke's codes.
peer_ocu

Other-Conferred Utility (OCU) Model
prl_ewa

Experience-Weighted Attraction Model
plot_ind

Plots individual posterior distributions using bayesplot.
igt_vpp

Value-Plus-Perseverance
print_fit

Print model-fits (mean LOOIC or WAIC values in addition to Akaike weights) of hBayesDM Models
igt_pvl_delta

Prospect Valence Learning (PVL) Delta
plot.hBayesDM

General Purpose Plotting for hBayesDM. This function plots hyper parameters.
plot_dist

Plots the histogram of MCMC samples.
multiplot

Function to plot multiple figures
prl_rp_multipleB

Reward-Punishment Model
prl_fictitious_multipleB

Fictitious Update Model
prl_fictitious_woa

Fictitious Update Model, without alpha (indecision point)
pstRT_rlddm1

Reinforcement Learning Drift Diffusion Model 1
prl_fictitious_rp_woa

Fictitious Update Model, with separate learning rates for positive and negative prediction error (PE), without alpha (indecision point)
prl_fictitious

Fictitious Update Model
prl_rp

Reward-Punishment Model
pstRT_rlddm6

Reinforcement Learning Drift Diffusion Model 6
pstRT_ddm

Drift Diffusion Model
prl_fictitious_rp

Fictitious Update Model, with separate learning rates for positive and negative prediction error (PE)
ra_noLA

Prospect Theory, without loss aversion (LA) parameter
rhat

Function for extracting Rhat values from an hBayesDM object
pst_gainloss_Q

Gain-Loss Q Learning Model
pst_Q

Q Learning Model
ra_prospect

Prospect Theory
ts_par6

Hybrid Model, with 6 parameters
ra_noRA

Prospect Theory, without risk aversion (RA) parameter
rdt_happiness

Happiness Computational Model
ts_par4

Hybrid Model, with 4 parameters
task2AFC_sdt

Signal detection theory model
ts_par7

Hybrid Model, with 7 parameters (original model)
ug_delta

Rescorla-Wagner (Delta) Model
ug_bayes

Ideal Observer Model
wcs_sql

Sequential Learning Model