You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Python/hbayesdm/models/_hgf_ibrb.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -54,11 +54,11 @@ def __init__(self, **kwargs):
54
54
('mu0', 'prior belief for each level before starting the experiment'),
55
55
('sigma0', 'prior uncertainty for each level before starting the experiment'),
56
56
('kappa_lower', 'Lower bounds for kappa for each level (2 ~ L-1). Defaults to [0] and can not be negative. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].'),
57
-
('kappa_upper', 'Upper bounds for kappa for each level (2 ~ L-1). Defaults to [3]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].'),
57
+
('kappa_upper', 'Upper bounds for kappa for each level (2 ~ L-1). Defaults to [2]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].'),
58
58
('omega_lower', 'Lower bounds for omega for each level (2 ~ L). Defaults to [-10. -15]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].'),
59
-
('omega_upper', 'Upper bounds for omega for each level (2 ~ L). Defaults to [5, 5]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].'),
59
+
('omega_upper', 'Upper bounds for omega for each level (2 ~ L). Defaults to [0, 0]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].'),
60
60
('zeta_lower', 'Upper bound for zeta. Defaults to 0 and can not be negative. Parameter value is fixed if zeta_lower == zeta_upper.'),
61
-
('zeta_upper', 'Upper bound for zeta. Defaults to 3. Parameter value is fixed if zeta_lower == zeta_upper.'),
61
+
('zeta_upper', 'Upper bound for zeta. Defaults to 2. Parameter value is fixed if zeta_lower == zeta_upper.'),
62
62
]),
63
63
**kwargs,
64
64
)
@@ -211,11 +211,11 @@ def hgf_ibrb(
211
211
- ``mu0``: prior belief for each level before starting the experiment
212
212
- ``sigma0``: prior uncertainty for each level before starting the experiment
213
213
- ``kappa_lower``: Lower bounds for kappa for each level (2 ~ L-1). Defaults to [0] and can not be negative. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].
214
-
- ``kappa_upper``: Upper bounds for kappa for each level (2 ~ L-1). Defaults to [3]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].
214
+
- ``kappa_upper``: Upper bounds for kappa for each level (2 ~ L-1). Defaults to [2]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].
215
215
- ``omega_lower``: Lower bounds for omega for each level (2 ~ L). Defaults to [-10. -15]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].
216
-
- ``omega_upper``: Upper bounds for omega for each level (2 ~ L). Defaults to [5, 5]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].
216
+
- ``omega_upper``: Upper bounds for omega for each level (2 ~ L). Defaults to [0, 0]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].
217
217
- ``zeta_lower``: Upper bound for zeta. Defaults to 0 and can not be negative. Parameter value is fixed if zeta_lower == zeta_upper.
218
-
- ``zeta_upper``: Upper bound for zeta. Defaults to 3. Parameter value is fixed if zeta_lower == zeta_upper.
218
+
- ``zeta_upper``: Upper bound for zeta. Defaults to 2. Parameter value is fixed if zeta_lower == zeta_upper.
Copy file name to clipboardExpand all lines: Python/hbayesdm/models/_hgf_ibrb_single.py
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -41,23 +41,23 @@ def __init__(self, **kwargs):
41
41
('mu0', [0.5, 1.0]),
42
42
('sigma0', [0.1, 1.0]),
43
43
('kappa_lower', [0]),
44
-
('kappa_upper', [3]),
44
+
('kappa_upper', [2]),
45
45
('omega_lower', [-10, -15]),
46
-
('omega_upper', [5, 5]),
46
+
('omega_upper', [0, 0]),
47
47
('zeta_lower', 0),
48
-
('zeta_upper', 3),
48
+
('zeta_upper', 2),
49
49
]),
50
50
additional_args_desc=OrderedDict([
51
51
('L', 'Total level of hierarchy. Defaults to minimum level of 3'),
52
52
('input_first', 'TRUE if participant observed u[t] before choosing y[t], FALSE if participant observed u[t] after choosing y[t]'),
53
53
('mu0', 'prior belief for each level before starting the experiment'),
54
54
('sigma0', 'prior uncertainty for each level before starting the experiment'),
55
55
('kappa_lower', 'Lower bounds for kappa for each level (2 ~ L-1). Defaults to [0] and can not be negative. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].'),
56
-
('kappa_upper', 'Upper bounds for kappa for each level (2 ~ L-1). Defaults to [3]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].'),
56
+
('kappa_upper', 'Upper bounds for kappa for each level (2 ~ L-1). Defaults to [2]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].'),
57
57
('omega_lower', 'Lower bounds for omega for each level (2 ~ L). Defaults to [-10. -15]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].'),
58
-
('omega_upper', 'Upper bounds for omega for each level (2 ~ L). Defaults to [5, 5]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].'),
58
+
('omega_upper', 'Upper bounds for omega for each level (2 ~ L). Defaults to [0, 0]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].'),
59
59
('zeta_lower', 'Upper bound for zeta. Defaults to 0 and can not be negative. Parameter value is fixed if zeta_lower == zeta_upper.'),
60
-
('zeta_upper', 'Upper bound for zeta. Defaults to 3. Parameter value is fixed if zeta_lower == zeta_upper.'),
60
+
('zeta_upper', 'Upper bound for zeta. Defaults to 2. Parameter value is fixed if zeta_lower == zeta_upper.'),
61
61
]),
62
62
**kwargs,
63
63
)
@@ -209,11 +209,11 @@ def hgf_ibrb_single(
209
209
- ``mu0``: prior belief for each level before starting the experiment
210
210
- ``sigma0``: prior uncertainty for each level before starting the experiment
211
211
- ``kappa_lower``: Lower bounds for kappa for each level (2 ~ L-1). Defaults to [0] and can not be negative. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].
212
-
- ``kappa_upper``: Upper bounds for kappa for each level (2 ~ L-1). Defaults to [3]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].
212
+
- ``kappa_upper``: Upper bounds for kappa for each level (2 ~ L-1). Defaults to [2]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].
213
213
- ``omega_lower``: Lower bounds for omega for each level (2 ~ L). Defaults to [-10. -15]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].
214
-
- ``omega_upper``: Upper bounds for omega for each level (2 ~ L). Defaults to [5, 5]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].
214
+
- ``omega_upper``: Upper bounds for omega for each level (2 ~ L). Defaults to [0, 0]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].
215
215
- ``zeta_lower``: Upper bound for zeta. Defaults to 0 and can not be negative. Parameter value is fixed if zeta_lower == zeta_upper.
216
-
- ``zeta_upper``: Upper bound for zeta. Defaults to 3. Parameter value is fixed if zeta_lower == zeta_upper.
216
+
- ``zeta_upper``: Upper bound for zeta. Defaults to 2. Parameter value is fixed if zeta_lower == zeta_upper.
Copy file name to clipboardExpand all lines: R/R/hgf_ibrb.R
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@
22
22
#' @templateVar ADDITIONAL_ARGS_3 \item{mu0}{prior belief for each level before starting the experiment}
23
23
#' @templateVar ADDITIONAL_ARGS_4 \item{sigma0}{prior uncertainty for each level before starting the experiment}
24
24
#' @templateVar ADDITIONAL_ARGS_5 \item{kappa_lower}{Lower bounds for kappa for each level (2 ~ L-1). Defaults to [0] and can not be negative. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].}
25
-
#' @templateVar ADDITIONAL_ARGS_6 \item{kappa_upper}{Upper bounds for kappa for each level (2 ~ L-1). Defaults to [3]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].}
25
+
#' @templateVar ADDITIONAL_ARGS_6 \item{kappa_upper}{Upper bounds for kappa for each level (2 ~ L-1). Defaults to [2]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].}
26
26
#' @templateVar ADDITIONAL_ARGS_7 \item{omega_lower}{Lower bounds for omega for each level (2 ~ L). Defaults to [-10. -15]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].}
27
-
#' @templateVar ADDITIONAL_ARGS_8 \item{omega_upper}{Upper bounds for omega for each level (2 ~ L). Defaults to [5, 5]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].}
27
+
#' @templateVar ADDITIONAL_ARGS_8 \item{omega_upper}{Upper bounds for omega for each level (2 ~ L). Defaults to [0, 0]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].}
28
28
#' @templateVar ADDITIONAL_ARGS_9 \item{zeta_lower}{Upper bound for zeta. Defaults to 0 and can not be negative. Parameter value is fixed if zeta_lower == zeta_upper.}
29
-
#' @templateVar ADDITIONAL_ARGS_10 \item{zeta_upper}{Upper bound for zeta. Defaults to 3. Parameter value is fixed if zeta_lower == zeta_upper.}
29
+
#' @templateVar ADDITIONAL_ARGS_10 \item{zeta_upper}{Upper bound for zeta. Defaults to 2. Parameter value is fixed if zeta_lower == zeta_upper.}
Copy file name to clipboardExpand all lines: R/R/hgf_ibrb_single.R
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@
21
21
#' @templateVar ADDITIONAL_ARGS_3 \item{mu0}{prior belief for each level before starting the experiment}
22
22
#' @templateVar ADDITIONAL_ARGS_4 \item{sigma0}{prior uncertainty for each level before starting the experiment}
23
23
#' @templateVar ADDITIONAL_ARGS_5 \item{kappa_lower}{Lower bounds for kappa for each level (2 ~ L-1). Defaults to [0] and can not be negative. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].}
24
-
#' @templateVar ADDITIONAL_ARGS_6 \item{kappa_upper}{Upper bounds for kappa for each level (2 ~ L-1). Defaults to [3]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].}
24
+
#' @templateVar ADDITIONAL_ARGS_6 \item{kappa_upper}{Upper bounds for kappa for each level (2 ~ L-1). Defaults to [2]. Parameter value is fixed for level l if kappa_upper[l] == kappa_lower[l].}
25
25
#' @templateVar ADDITIONAL_ARGS_7 \item{omega_lower}{Lower bounds for omega for each level (2 ~ L). Defaults to [-10. -15]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].}
26
-
#' @templateVar ADDITIONAL_ARGS_8 \item{omega_upper}{Upper bounds for omega for each level (2 ~ L). Defaults to [5, 5]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].}
26
+
#' @templateVar ADDITIONAL_ARGS_8 \item{omega_upper}{Upper bounds for omega for each level (2 ~ L). Defaults to [0, 0]. Parameter value is fixed for level l if omega_upper[l] == omega_lower[l].}
27
27
#' @templateVar ADDITIONAL_ARGS_9 \item{zeta_lower}{Upper bound for zeta. Defaults to 0 and can not be negative. Parameter value is fixed if zeta_lower == zeta_upper.}
28
-
#' @templateVar ADDITIONAL_ARGS_10 \item{zeta_upper}{Upper bound for zeta. Defaults to 3. Parameter value is fixed if zeta_lower == zeta_upper.}
28
+
#' @templateVar ADDITIONAL_ARGS_10 \item{zeta_upper}{Upper bound for zeta. Defaults to 2. Parameter value is fixed if zeta_lower == zeta_upper.}
Copy file name to clipboardExpand all lines: R/vignettes/bibtex/hBayesDM_bib_short.bib
+94Lines changed: 94 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,20 @@
8
8
%% Saved with string encoding Unicode (UTF-8)
9
9
10
10
11
+
@article{ahn2017hbayesdm,
12
+
Author = {Ahn, Woo-Young and Haines, Nathaniel and Zhang, Lei},
13
+
Date-Added = {2025-09-02 16:20:00 +0000},
14
+
Date-Modified= {2025-09-02 16:20:00 +0000},
15
+
Journal = {Computational Psychiatry},
16
+
Pages = {24--57},
17
+
Publisher = {MIT Press},
18
+
Title = {Revealing Neurocomputational Mechanisms of Reinforcement Learning and Decision-Making With the hBayesDM Package},
19
+
Volume = {1},
20
+
Year = {2017},
21
+
Month = {October},
22
+
DOI = {10.1162/CPSY\_a\_00002},
23
+
PMID = {29601060},
24
+
PMCID = {PMC5869013}}
11
25
12
26
@article{aylward2018,
13
27
Author = {Aylward, Jessica and Valton, Vincent and Ahn, Woo-Young and Bond, Rebecca L and Dayan, Peter and Roiser, Jonathan P and Robinson, Oliver J},
@@ -28,6 +42,63 @@ @article{mathys2011bayesian
28
42
Volume = {5},
29
43
Year = {2011}}
30
44
45
+
@article{mathys2014hgf,
46
+
Author = {Mathys, Christoph and Lomakina, Ekaterina I and Daunizeau, Jean and Iglesias, Susana and Brodersen, Kay H and Friston, Karl J and Stephan, Klaas Enno},
47
+
Date-Added = {2025-09-01 19:00:00 +0000},
48
+
Date-Modified = {2025-09-01 19:00:00 +0000},
49
+
Journal = {Frontiers in Human Neuroscience},
50
+
Pages = {825},
51
+
Publisher = {Frontiers},
52
+
Title = {Uncertainty in perception and the Hierarchical Gaussian Filter},
53
+
Volume = {8},
54
+
Year = {2014}}
55
+
56
+
@article{tecilla2023modulation,
57
+
Author = {Tecilla, Margherita and Großbach, Michael and Gentile, Giovanni and Holland, Peter and Sporn, Sebastian and Antonini, Angelo and Herrojo Ruiz, Maria},
58
+
Date-Added = {2025-09-01 19:00:00 +0000},
59
+
Date-Modified= {2025-09-01 19:00:00 +0000},
60
+
Journal = {Journal of Neuroscience},
61
+
Pages = {1757--1777},
62
+
Publisher = {Society for Neuroscience},
63
+
Title = {Modulation of Motor Vigor by Expectation of Reward Probability Trial-by-Trial Is Preserved in Healthy Ageing and Parkinson's Disease Patients},
64
+
Volume = {43},
65
+
Number = {10},
66
+
Year = {2023},
67
+
Month = {Mar},
68
+
Day = {8},
69
+
DOI = {10.1523/JNEUROSCI.1583-22.2022},
70
+
PMID = {36732072},
71
+
PMCID = {PMC10010462}}
72
+
73
+
@article{hein2021state,
74
+
Author = {Hein, Thomas P. and de Fockert, Jan and Herrojo Ruiz, Maria},
75
+
Date-Added = {2025-09-01 19:00:00 +0000},
76
+
Date-Modified= {2025-09-01 19:00:00 +0000},
77
+
Journal = {NeuroImage},
78
+
Pages = {117424},
79
+
Publisher = {Elsevier},
80
+
Title = {State anxiety biases estimates of uncertainty and impairs reward learning in volatile environments},
Author = {Reed, Emily J and Uddenberg, Stefan and Suthaharan, Praveen and Mathys, Christoph D and Taylor, John R and Groman, Stephanie M and Corlett, Philip R},
90
+
Date-Added = {2025-09-02 00:00:00 +0000},
91
+
Date-Modified= {2025-09-02 00:00:00 +0000},
92
+
Journal = {Elife},
93
+
Title = {Paranoia as a deficit in non-social belief updating},
94
+
Volume = {9},
95
+
Year = {2020},
96
+
Month = {May},
97
+
Day = {26},
98
+
DOI = {10.7554/eLife.56345},
99
+
PMID = {32452769},
100
+
PMCID = {PMC7326495}}
101
+
31
102
@article{bishara2010sequential,
32
103
Author = {Bishara, Anthony J and Kruschke, John K and Stout, Julie C and Bechara, Antoine and McCabe, David P and Busemeyer, Jerome R},
33
104
Date-Added = {2018-09-11 18:59:00 +0000},
@@ -565,3 +636,26 @@ @article{Busemeyer2000a
565
636
Title = {Model Comparisons and Model Selections Based on Generalization Criterion Methodology},
566
637
Volume = {44},
567
638
Year = {2000}}
639
+
640
+
@article{heathcote2015goodpractices,
641
+
Author = {Heathcote, Andrew and Brown, Scott D. and Wagenmakers, Eric-Jan},
642
+
Date-Added = {2025-09-02 16:40:00 +0000},
643
+
Date-Modified= {2025-09-02 16:40:00 +0000},
644
+
Journal = {Cognitive Science},
645
+
Pages = {1069--1080},
646
+
Title = {An Introduction to Good Practices in Cognitive Modeling},
647
+
Volume = {39},
648
+
Number = {5},
649
+
Year = {2015}}
650
+
651
+
@article{wilson2019tenrules,
652
+
Author = {Wilson, Robert C and Collins, Anne GE},
653
+
Date-Added = {2025-09-02 00:00:00 +0000},
654
+
Date-Modified= {2025-09-02 00:00:00 +0000},
655
+
Journal = {eLife},
656
+
Pages = {e49547},
657
+
Publisher = {eLife Sciences Publications},
658
+
Title = {Ten simple rules for the computational modeling of behavioral data},
Copy file name to clipboardExpand all lines: R/vignettes/getting_started.Rmd
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ We introduce a free R package **hBayesDM**, which offers HBA of various computat
29
29
30
30
## Why hierarchical Bayesian analysis (HBA)?
31
31
32
-

32
+

33
33
34
34
Most computational models do not have closed form solutions and we need to estimate parameter values. Traditionally parameters are estimated at the individual level with maximum likelihood estimation (MLE): getting point estimates for each individual separately. However, individual MLE estimates are often noisy especially when there is insufficient amount of data. A group-level analysis (e.g., group-level MLE), which estimate a single set of parameters for the whole group of individuals, may generate more reliable estimates but inevitably ignores individual differences.
35
35
@@ -116,7 +116,7 @@ library(hBayesDM)
116
116
Four steps of doing HBA with hBayesDM are illustrated below. As an example, four models of the orthogonalized Go/Nogo task (Guitart-Masip et al., 2012; Cavanagh et al., 2013) are fit and compared with the hBayesDM package.
We are planning to add more tasks/models. We plan to include the following tasks and/or models in the near future. If you have any requests for a specific task or a model, please let us know.
0 commit comments