Tools and setup

Core tools

The course assumes access to:

  • Quarto for rendering documents and websites;
  • R for simulation, plotting, diagnostics, and cmdstanr workflows;
  • Python 3.11 or newer for JAX;
  • CmdStan if you want to run the Stan labs locally.

Local setup

Quarto

Install Quarto, then render the site with:

quarto render

R

Install the required R packages with:

Rscript install.R

If you also want CmdStan, run:

INSTALL_CMDSTAN=true Rscript install.R

Python / JAX

Install Python dependencies with:

python -m pip install -r requirements.txt

Cloud setup

Recommended cloud pathways:

  • Posit Cloud for R and Stan;
  • Binder for lightweight JAX examples;
  • Codespaces for the full repository-backed experience.

Lab file locations

Language Path Purpose
R labs/r/probability_foundations_demo.R LLN, CLT, dependence, and Jacobian demonstrations
R labs/r/likelihood_geometry.R Likelihood curvature, MLEs, profile likelihood, and posterior comparison
R labs/r/beta_binomial.R Conjugate updating and posterior prediction
R labs/r/conjugate_families.R Exact posterior updates across conjugate families
R labs/r/laplace_importance_sampling.R Laplace approximation and importance sampling
R labs/r/monte_carlo_variance_reduction.R Crude Monte Carlo, antithetic variables, control variates, and weighted ESS
R labs/r/mh_sampler.R Random-walk Metropolis implementation
R labs/r/decision_rules.R Posterior risk and Bayes estimators
R labs/r/prior_predictive_logistic.R Prior predictive simulation for logistic regression
R labs/r/meanfield_vi_normal_gamma.R Mean-field CAVI for a Normal-Gamma model
R labs/r/particle_filter_local_level.R Bootstrap particle filter for a local-level model
R labs/r/bayesian_linear_regression.R Closed-form Bayesian linear regression and prediction
R labs/r/glm_logistic_poisson.R Logistic and Poisson posterior building blocks
R labs/r/hierarchical_partial_pooling.R Partial-pooling shrinkage geometry
R labs/r/mixture_label_switching.R Allocation updates and label switching
R labs/r/gaussian_process_regression.R Exact Gaussian-process posterior prediction
R labs/r/hmm_forward_algorithm.R Forward recursion for a hidden Markov model
R labs/r/causal_sensitivity_grid.R Treatment-effect sensitivity grid
R labs/r/map_logistic_newton.R MAP optimization with Newton updates
R labs/r/mcmc_tuning_grid.R Proposal-scale tuning study for Metropolis
R labs/r/posterior_predictive_checks.R Basic posterior predictive discrepancy checks
R labs/r/simulation_based_calibration_demo.R SBC rank-histogram demonstration
R labs/r/model_averaging_weights.R Marginal likelihood, BMA, and stacking weights
R labs/r/robust_t_vs_gaussian.R Robust regression with Gaussian versus Student-t likelihood
R labs/r/expected_utility_design.R Analytic and Monte Carlo Bayesian design utility
R labs/r/posterior_reporting_summary.R Posterior summaries on transformed and predictive scales
Stan labs/stan/eight_schools.stan Canonical hierarchical model
R labs/r/fit_eight_schools.R cmdstanr wrapper for the Stan lab
Python/JAX labs/jax/jax_logistic_map_hmc.py Autodiff, MAP, and basic HMC-style demo
Python/JAX labs/jax/hmc_gaussian_demo.py HMC geometry on a correlated Gaussian target

Project templates

The site also includes reusable authoring templates for longer project work:

  • templates/project-proposal-template.qmd
  • templates/final-project-report-template.qmd

Reproducibility advice

  • Fix random seeds in all stochastic examples.
  • Record package versions for each course release.
  • Keep model files and wrapper scripts in separate language-specific folders.
  • Prefer explicit data preparation code over hidden preprocessing.
Back to top