Environment settings

6. Environment settings#



In this section, we outline the computational environment and core tools used throughout the project. Our implementation relies primarily on \(\bf{Stan}\) for Bayesian sampling and \(\bf{Gurobi}\) for solving optimization problems.

  • Stan is a probabilistic programming language designed for statistical modeling and high-performance Bayesian inference. We use it to implement hierarchical models and sample from posterior distributions using Hamiltonian Monte Carlo (HMC) and its No-U-Turn Sampler (NUTS) variant. Here is the link to the tutorial for first time users: https://mc-stan.org/install/.

  • Gurobi is employed as the primary solver for numerical optimization tasks, particularly when handling high-dimensional or constrained problems. Its efficiency and robustness make it suitable for solving large-scale convex and non-convex formulations. See: https://www.gurobi.com/.

All code is written in Python and R, leveraging Jupyter Notebooks for interactive analysis.

6.1. Installation#

  1. Clone git repository

git clone https://github.com/patohdzs/amazon-carbon-prices
git checkout fix_bayesian_model
  1. Create and activate a new virtual environment

python -m venv .venv
source .venv/bin/activate
  1. Install CmdStan

install_cmdstan --overwrite
  1. Regester gurobi license (free if using academic license)

export GRB_LICENSE_FILE=/home/pengyu/gurobi.lic

6.2. Questions#

For a full replication of the results in the paper, please refer to the git repository here.

If you have any questions about the website, please contact the authors.