=================================================
PyBefit is a Python library for Bayesian analysis of behavioral data. It is based on Pyro/Numpyro a probabilistic programing language, PyTorch, and Jax machine learning libraries.
pyro
pytorch
numpyro
jax
[Optional]
- matplolib
- seaborn
- arviz
- jupyterlab
To install PyBefit with CPU-only versions of JAX and PyTorch you can run
pip install pip --upgrade
pip install pybefit --upgrade
To install either JAX or Pytorch with Nvidia GPU support we recomment using anaconda package manager. First create pybefit environment and activate it
conda create -n befit python=3.11
conda activate befit
Then follow instructions for installing JAX or Pytorch with GPU support.
Finally install pybefit via pip within the conda environment
pip install pip --upgrade
pip install pybefit --upgrade
For development you can install pybefit directly from repo as follows
git clone https://github.com/dimarkov/pybefit.git
cd pybefit
pip install pip --upgrade
pip install -e .
PyBefit is used as a basis for several projects:
-
The code and notebooks in
examples/control_dilemmas/
acompanies the following paper - Marković et al. "Meta-control of the exploration-exploitation dilemma emerges from probabilistic inference over a hierarchy of time scales." Cognitive, Affective, & Behavioral Neuroscience (2020): 1-25 and can be used to reproduce all the figures. -
The code and notebooks in
examples/social_influence/
shows the analysis of behavioural data of subjects in different age groups performing the social influence task. We use a range of computational models of behaviour in changing environments and present their age group dependent comparison. -
The code and notebooks in
examples/temporal_rev_learn
acompanies the following paper - Marković, Dimitrije, Andrea MF Reiter, and Stefan J. Kiebel. "Revealing human sensitivity to a latent temporal structure of changes." (2022). In the paper we analyse the behavioural data of subjects performing a temporally structured reversal learning task. The goal here is to demonstrate subjects' learning of latent temporal strucure of a noisy and dynamic environment. -
The code and notebooks in
examples/plandepth
illustrates the model for inferring participants planning depth, while they are performing the Space Adventure Task SAT.
See license