Jupyter Notebooks
The course notebooks provide executable examples of Monte Carlo and quasi-Monte Carlo concepts, algorithms, applications, and computational performance. They are intended to complement the lectures and give students code that can be explored and adapted.
Notebooks will be organized by topic. Links will be added after each notebook has been migrated to the Fall 2026 repository, updated for the current course environment, and validated from a clean setup.
Notebook content is being migrated from the previous course offering. Each notebook is linked here only after it has been updated and validated in the Fall 2026 course environment.
Sampling
Notebooks on random and low discrepancy sample generation, acceptance-rejection sampling, conditional Monte Carlo, Markov chain Monte Carlo, and related sampling methods will appear here.
- Generating Samples — construct and transform IID and low discrepancy samples, including binomial, zero-inflated exponential, Gaussian-process, Brownian-motion, and financial-option examples; choose randomized lattice or Sobol’ in the low discrepancy comparisons
- Low Discrepancy Constructions — recover lattice generators and digital columns from the first points; explore Kronecker increments, randomization, projections, and a fixed-integrand comparison
- Transport Maps and Acceptance–Rejection — compare transport maps and rejection sampling using scalar and banana-shaped targets
- Metropolis–Hastings — explore proposal scales, repeated states, separated-mode trapping, and parallel tempering
- Conditional Monte Carlo — compare conditional density estimates with histograms and KDE using IID and randomized Sobol’ points; estimate an arithmetic Asian-average density and separate the Asian call’s zero-payoff mass from its positive-payoff density
Applications
Are We There Yet? — use a travel-time model to explore Monte Carlo convergence, error assessment, quantiles, conditional Monte Carlo, and randomized Sobol sampling
Bayesian MCMC — compare posterior sampling with exact benchmarks and explore multiple-chain diagnostics and tempering
Queue Simulation — simulate single-server queues and drive-through blocking with SimPy; compare customer delays, time-average congestion, and stationary benchmarks
Keister Example — choose among transformed integrands with the same integral; compare IID, replicated Sobol’, and Walsh-decay stopping rules, including budget exhaustion
Logistic Regression with SGD — Parts 5–6 of the Stochastic Gradient Descent notebook in Performance; fit a binary-response model and compare optimization cost, diagnostic loss, and accuracy checks
Monte Carlo Tree Search — choose an airport itinerary using simulated traffic; draw the search tree, follow selection, expansion, rollout and backup, and compare adaptive search with uniform route sampling at the same simulation budget
Additional notebooks will apply Monte Carlo and quasi-Monte Carlo methods to other examples.
Performance
- Discrepancy — compare empirical distributions using maximum mean discrepancy, kernel scales, and witness functions
- Asian Option Variance Reduction — choose randomized Sobol’ (default), lattice, or Halton sampling and compare drift, a European-call control variate, and their combination; price a discretely monitored lookback call and stop price estimation at a requested uncertainty tolerance and account for pilot work
- Multilevel Option Pricing — couple coarse and fine Brownian paths for a continuous-average Asian call; compare level allocations, direct fine estimation, IID MLMC, and randomized Sobol’ MLQMC while distinguishing sample counts, work, pilot cost, sampling error, and discretization bias
- Multilevel Beam — use a simple Python cantilever-beam model to compare coupled corrections, sample allocations, and approximation bias against an exact reference; includes QMCPy’s adaptive MLMC solver and requires no external model service
- Stochastic Gradient Descent — compare GD and BFGS on Rosenbrock; separate conditioning from dimension, measure mini-batch noise and learning-rate effects, and compare logistic regression methods by gradient work and elapsed time