A visual and practical guide to Monte Carlo techniques, focused on understanding rather than memorizing.
Each method is implemented from scratch and explored through intuitive diagrams, animations, and diagnostic tools.
These foundations support real applications in robotics, dynamics, and reinforcement learning, from Bayesian filters to sampling-based planning and uncertainty-aware control.
- Overview
- Sampling Visualizations
- Importance Sampling
- Control Variates
- Brownian Motion
- Markov Chain Monte Carlo
- Notebook Gallery
- PDF Chapter Library
- Project Structure
- About Me
This repository builds Monte Carlo ideas from first principles using:
- Random variable generation: inverse transform, accept–reject, importance sampling
- Monte Carlo estimation: WLLN, SLLN, CLT
- Variance reduction: control variates, Brownian motion scaling
- Markov Chain Monte Carlo: MH, AM, DR, DRAM
- Full diagnostics: burn-in, mixing, autocorrelation, integrated autocorrelation, ESS
Each topic is supported by clean visualizations and self-contained Jupyter notebooks.
Inverse Transform sampling (left) and Accept–Reject sampling (right).
Proposal vs likelihood alignment and resulting posterior for Importance Sampling.
Variance comparison (left) and correlation structure enabling control variates (right).
Random-walk scaling to Brownian motion and simulated sample paths.
The repository implements four MCMC algorithms on both 2D Gaussian and banana-shaped targets:
- Metropolis–Hastings (MH)
- Adaptive Metropolis (AM)
- Delayed Rejection (DR)
- Delayed Rejection Adaptive Metropolis (DRAM)
All diagnostics: burn-in, mixing, autocorrelation, integrated autocorrelation, and ESS, are derived in the MH diagnostics notebook and reused across the remaining algorithms.
Below is a DRAM example on the banana-shaped target.
- MH Diagnostics
- Adaptive Metropolis — Gaussian
- Adaptive Metropolis — Banana
- Delayed Rejection — Gaussian
- Delayed Rejection — Banana
- DRAM — Gaussian
- DRAM — Banana
Full write-ups:
reports/ch02_general_transforms.pdfreports/ch02_accept_reject.pdfreports/ch03_01_ImportantSampling_Motivation_weights.pdfreports/ch03_02_ImportanceSampling_MC_vs_IS_Variance_Comparison.pdfreports/ch03_03_ImportanceSampling_Rare_event_Estimation.pdfreports/ch03_04_SelfNormalized_ImportantSampling.pdfreports/ch04_01_ControlVariate_Foundations-and-Intution.pdfreports/ch04_02_Brownian_Motion.pdfreports/ch04_03_ControlVariate_example1.pdfreports/ch05_01_MarkovChain_Intro.pdfreports/ch05_02_Irreducibility.pdfreports/ch05_07_Metropolis-Hastings.pdf
MonteCarlo-Statistical-Methods/
│
├── animations/
├── images/
│ ├── sampling/
│ ├── importance_sampling/
│ ├── variance_reduction/
│ ├── stochastic_processes/
│ ├── mcmc/
│ └── exponential/
├── notebooks/
│ ├── ch02_sampling/
│ ├── ch03_importance_sampling/
│ ├── ch04_variance_reduction/
│ ├── ch05_mcmc/
│ └── ch06_stochastic_processes/
├── reports/
├── src/
├── README.md
├── index.md
└── pyproject.toml
I study and implement methods in optimization, control, robotics, Bayesian inference, and probabilistic reasoning.
- GitHub: https://github.com/SaiSampathKedari
- LinkedIn: https://linkedin.com/in/sai-sampath-kedari
- X: https://x.com/SSampathKedari
- Email: sampath@umich.edu











