Tools and models for bayesian data analysis.
-
This package works for
python >= 3.8
. It is strongly suggested to create a dedicated python environment, for example usingvirtualenv
, which can be installed with pippip install virtualenv
-
Automatic installation of
CmdStan
requiresg++>=4.9.3
andmake>=3.81
Open the terminal and clone the repository locally:
use a password protected SSH key
git clone git@github.com:cryomib/baynes.git
or Clone with HTTPS using the web URL
git clone https://github.com/cryomib/baynes.git
Move into the repository and run the install script
cd baynes
source install.sh
This will automatically execute all the steps of the manual installation using a default configuration.
-
Create the baynes virtual environment based on
python3.X (X>=8)
and activate it.pip install virtualenv virtualenv -p `which python3.X` baynesenv source baynesenv/bin/activate
(optional) Check the version of python being used in the virtual environment
(baynesenv) python -V
-
Install the required Python packages and dependencies, which include CmdStanPy. With the virtual environment active, move into the
baynes
folder and install the package with pip.(baynesenv) cd baynes (baynesenv) pip install .
(optional)
-
Install CmdStan and Stan. If
g++>=4.9.3
andmake>=3.81
are already present, this can be done automatically using CmdStanPy's built-in functioninstall_cmdstan
:(baynesenv) install_cmdstan
By default, this will install CmdStan and Stan's core utilities in
$HOME/.cmdstan
. For more informations, see https://mc-stan.org/cmdstanpy/installation.htmlIf you want a custom CmdStan installation, follow https://mc-stan.org/docs/cmdstan-guide/cmdstan-installation.html
Note: do not follow the conda installation procedure.
-
(optional)
baynes
allows to retrieve the Stan models from a user defined directory and set the default Stan compiler options. Run:(baynesenv) python scripts/set_defaults.py
This will set
baynes/stan/
as the models' base folder and addbaynes/stan/include/
to the compiler search path. Otherwise, the arguments specified inbaynes/config.json
will be used as defaults. Additional default values can be set by updating the config dictionary with dedicated functions found inbaynes/model_utils.py
. -
(optional) install the jupyter kernel to make
baynesenv
available in notebooks(baynesenv) ipython kernel install --user --name=baynesenv
Note: Jupyter notebooks must be run after deactivating the environment.
baynes
│
├── baynes # Project source code
├── examples # Jupyter Notebooks demonstrating various models and techniques
├── scripts # Simple python scripts for configuration
├── stan # Collection of tested Stan models and functions
├── requirements.txt # Requirements file specifing the python packages to install
├── setup.py # Package installation script
├── install.sh # Full automatic installation script
├── .gitignore # Specifies intentionally untracked files to ignore
└── README.md # README file
ASCII art tree structure taken from here