Skip to content

Commit 206198a

Browse files
committed
Import of v7.1.2
1 parent b263aa9 commit 206198a

File tree

268 files changed

+24750
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+24750
-0
lines changed

COPYING

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Manual.pdf

761 KB
Binary file not shown.

README.md

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
# HGF Toolbox
2+
Release ID: $Format:%h %d$
3+
4+
---
5+
6+
Copyright (C) 2012-2022 Christoph Mathys <[email protected]>
7+
Translational Neuromodeling Unit (TNU)
8+
University of Zurich and ETH Zurich
9+
10+
---
11+
12+
The HGF toolbox is free software: you can redistribute it and/or
13+
modify it under the terms of the GNU General Public License as
14+
published by the Free Software Foundation, either version 3 of the
15+
License, or (at your option) any later version.
16+
17+
This program is distributed in the hope that it will be useful, but
18+
WITHOUT ANY WARRANTY; without even the implied warranty of
19+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20+
General Public License for more details.
21+
22+
You should have received a copy of the GNU General Public License
23+
along with this program (see the file COPYING). If not, see
24+
<http://www.gnu.org/licenses/>.
25+
26+
---
27+
28+
## How to cite the HGF Toolbox
29+
Please cite the following paper when using the HGF Toolbox:
30+
31+
Frässle, S., et al. (2021). TAPAS: An Open-Source Software Package for
32+
Translational Neuromodeling and Computational Psychiatry. Frontiers in
33+
Psychiatry, 12:680811. https://doi.org/10.3389/fpsyt.2021.680811
34+
35+
36+
## Installation
37+
38+
Move this folder to a location of your choice and add it to your Matlab
39+
path.
40+
41+
42+
## Documentation and configuration
43+
44+
Documentation can be found in the manual contained in the Manual.pdf
45+
file. This will point you to the relevant configuration files. Further
46+
documentation is available throughout the source code.
47+
48+
49+
## Tutorial demo
50+
51+
There is a Matlab LiveScript tutorial demo that can be launched by
52+
opening hgf_demo.mlx in Matlab. A PDF version is available in
53+
hgf_demo.pdf.
54+
55+
## Release notes
56+
57+
### v7.1
58+
- Add ehgf_ar1_plotTraj
59+
- Bugfix
60+
### v7.0
61+
- Numerical stability improvements to optimization
62+
- Combined response models (more than one observation per trial)
63+
- Various bugfixes and minor improvements
64+
65+
### v6.1
66+
- Improved functionality of beta_obs response model
67+
- Included reference to TAPAS paper
68+
69+
### v6.0
70+
- Introduced first eHGF models (ehgf, ehgf_binary, ehgf_jget)
71+
- Enabled calling fitModel with config structures as arguments
72+
- Enabled changing config structures on the fly
73+
- Introduced sampleModel for sampling from the prior
74+
- Various other additions, improvements, and bugfixes
75+
76+
### v5.3
77+
- Enabled setting and storing of seed for random number generator in simulations
78+
- Debugged reading of response model configuration in simModel
79+
- Reduced default maxStep from 2 to 1 in quasinewton_oqptim_config
80+
- Improved readability of siem files for unitsq_sgm and softmax_binary
81+
- Added simulation capability for softmax_wld and softmax_mu3_wld
82+
- Added softmax_wld response model
83+
- Improved readability of softmax_mu3_wld code
84+
- Improved readability of softmax and softmax_mu3 code
85+
86+
### v5.2
87+
- Brought hgf_demo.pdf up to date
88+
- Added gaussian_obs_offset response model
89+
- Brought example in simModel up to date
90+
- Added sim and namep files for unitsq_sgm_mu3
91+
- Fixed typo in softmax_mu3_wld
92+
- Introduced softmax_mu3_wld decision model
93+
- Estimate mu0_2 by default in hgf_ar1_binary_mab
94+
- Improved comment in softmax_mu3_config
95+
- Change to pi_2 update in hgf_ar1_binary_mab
96+
- Enabled simulation for hgf_ar1_binary_mab
97+
- Added softmax_mu3
98+
- Added hgf_ar1_binary_mab
99+
- Fixed automatic detection of number of levels in hgf_ar1_binary
100+
- Fixed documentation of hgf_ar1_binary
101+
- Fixed hgf_binary_mab_plotTraj
102+
- Fixed trajectory calculations in hgf_binary_mab
103+
- Adapted riddersgradient and riddershessian to new Matlab versions
104+
- Quashed bug in rw_binary_dual found by [email protected]
105+
106+
### v5.1
107+
- Added condhalluc_obs and condhalluc_obs2 models
108+
- Introduced kappa1 in all binary HGF models
109+
110+
### v5.0
111+
- Ported interactive demo to Matlab LiveScript
112+
- Various additional small improvements
113+
- Updated manual
114+
- Updated and renamed README to README.md
115+
116+
### v4.17
117+
- Improvements to logrt_linear_binary_minimal
118+
119+
### v4.16
120+
- Added the binary HGF with trial-by-trial perceptual uncertainty as hgf_binary_pu_tbt
121+
122+
### v4.15
123+
- Added the Kalman filter as kf
124+
125+
### v4.14
126+
- Improved the beta_obs model
127+
- Improved calculation of implied 1st-level learning rate
128+
129+
### v4.13
130+
- Corrected sign of update trajectories
131+
- Added option to base responses on predictions or posteriors in
132+
the beta_obs model
133+
134+
### v4.12
135+
- Added tapas_autocorr.m
136+
137+
### v4.11
138+
- Predictions and residuals returned by all observations models
139+
- Added tapas_fit_plotResidualDiagnostics()
140+
141+
### v4.10
142+
- Added hgf_categorical_norm
143+
- Added Boltzmann distribution (i.e., softmax normalization) as tapas_boltzmann()
144+
145+
### v4.9
146+
- Set implied learning rate at first level to 0 if update is zero
147+
148+
### v4.8
149+
- Give choice of using predictions or posteriors with softmax_binary
150+
151+
### v4.7
152+
- Added cdfgaussian_obs model
153+
- Added hgf_binary_pu (perceptual uncertainty) model
154+
- Improvements for beta_obs with hgf_whichworld
155+
156+
### v4.6
157+
- Adapted beta_obs to deal with ph_binary
158+
- Added Pearce-Hall in ph_binary
159+
- Clarified the role of default settings in comments of fitModel
160+
- Brought softmax_binary_sim up to date
161+
162+
### v4.5
163+
- Improved comments in softmax_binary_sim
164+
- Improved comments in tapas_beta_obs.m
165+
- Added tapas_beta_obs_{sim,namep}.m
166+
167+
### v4.4
168+
- Added tapas_hgf_ar1_binary_namep.m
169+
- Improved rw_binary
170+
171+
### v4.3
172+
- Added bayes_optimal_categorical
173+
- Improved hgf_categorical_plotTraj
174+
175+
### v4.2
176+
- Adapted softmax_sim to hgf_categorical
177+
- Added hgf_categorical
178+
- Added datagen_categorical and categorical data example
179+
180+
### v4.1
181+
- Improved hgf_jget
182+
183+
### v4.0
184+
- Added PDF manual
185+
- Added interactive demo in hgf_demo
186+
- Added file of raw commands from hgf_demo in hgf_demo_commands
187+
- Adapted fitModel to calculate AIC and BIC
188+
- Renamed F (negative variational free energy) to LME (log-model evidence, to
189+
which it is an approximation)
190+
- Calculate accuracy and complexity in fitModel
191+
- Save everything relating to model quality under r.optim
192+
- Improved output of fitModel
193+
- Added hierarchical hidden Markov model (hhmm)
194+
- Added hidden Markov model (hmm)
195+
- Added WhatWorld (hgf_whatworld) model
196+
- Added linear log-reaction time (logrt_linear_whatworld) model for WhatWorld
197+
- Added WhichWorld (hgf_whichworld) model
198+
- Added AR(1) model for binary outcomes (hgf_ar1_binary)
199+
- Added Jumping Gaussian Estimation (hgf_jget) model
200+
- Added unitsq_sgm_mu3 decision model
201+
- Added binary multi-armed bandit model hgf_binary_mab
202+
- Added beta_obs observation model for decision noise on the unit interval
203+
- Added softmax decision model with different inverse temperature for each
204+
kind of binary decision (softmax_2beta)
205+
- Added logrt_linear_binary decision model
206+
- Added Rescorla-Wagner model with different learning rate for each kind of
207+
binary outcome (rw_binary_dual)
208+
- Included additional trajectories in output of hgf, hgf_ar1, hgf_ar1_mab,
209+
hgf_binary, hgf_ar1_binary, hgf_binary_mab, hgf_whichworld, and
210+
hgf_whatworld
211+
- Made infStates more consistent across models
212+
- Removed deprecated hgf_binary3l
213+
- Made fitModel explicitly return negative log-joint probability and negative
214+
log-likelihood
215+
- Modified simModel to read configuration files of perceptual and observation
216+
models
217+
- Abolished theta in hgf, hgf_binary, hgf_ar1, hgf_ar1_mab, hgf_ar1_binary,
218+
hgf_binary_mab, and hgf_jget
219+
- Moved kappa estimation from logit-space to log-space for hgf, hgf_binary,
220+
hgf_ar1, hgf_ar1_mab, hgf_ar1_binary, hgf_binary_mab, and hgf_jget
221+
- Introduced checking for implausible jumps in trajectories for hgf,
222+
hgf_binary, hgf_ar1, hgf_ar1_mab, hgf_ar1_binary, hgf_binary_mab, and
223+
hgf_jget
224+
- Adapted fitModel to deal with cases the <prc_model>_transp() function
225+
performs operations important to the <model>() function
226+
- Introduced multinomial softmax decision model
227+
- Improved documentation for hgf_ar1_mab model
228+
- Added error IDs for all errors
229+
230+
### v3.0
231+
- Improved error handling in tapas_fitModel()
232+
- Prefixed all function names with “tapas_
233+
- Added rs_precision
234+
- Added rs_belief
235+
- Added rs_surprise
236+
- Added sutton_k1
237+
- Added hgf_ar1_mab
238+
- Added softmax for continuous responses
239+
- Improved checking of trajectory validity in HGF models
240+
- Debugged input handling in softmax_binary
241+
242+
### v2.1
243+
- Introduced Bayesian parameter averaging
244+
- Amended calculation of log-priors in fitModel.m
245+
- Debugged construction of time axis in hgf_plotTraj
246+
- Debugged removal of placeholder field in estimate structure
247+
248+
### v2.0
249+
- Estimation of Bayes optimal parameters added
250+
- infStates the same 3-dim array in hgf_binary as in hgf
251+
- Changes to softmax_binary: trial-by-trial rewards read from input matrix
252+
- hgf_binary generalized to n levels
253+
- Old hgf_binary lives on as hgf_binary3l
254+
- Input at irregular intervals enabled in hgf and hgf_binary
255+
- Support for constant drift in hgf and hgf_binary
256+
- Introduced use of placeholders in config files
257+
- quasinewton_optim: increased default maximum number of regularizations to 16
258+
- Automatic detection of upper bound on theta for hgf
259+
- Improved input checks
260+
- Support for AR(1) processes in new hgf_ar1
261+
- quasinewton_optim: improved resetting after exhaustion of regularizations
262+
263+
### v1.0
264+
- Original release

0 commit comments

Comments
 (0)