Course · Python code

Python code that reproduces the figures

One module per chapter of Wasserman, All of Statistics (2004), with one function per figure, linked to the lecture notes. The code is written for this course with numpy, scipy, pandas, matplotlib and scikit-learn, and reads the book's own data sets.

How to run it

  1. Install Python 3 with numpy, scipy, pandas, matplotlib and scikit-learn.
  2. Run one chapter with python3 ch09_parametric_inference.py, list its figures with --list, make one with --fig 9.1, or run every chapter with python3 make_all.py --figures.

The book's data sets are downloaded once from its website into a local cache. Each figure is written to img/chNN/ as PNG, SVG and PDF. Shared helpers are in common.py.

Chapter 1. Probability

Module: ch01_probability.py · Notes: Probability

8 figures

Chapter 2. Random Variables

Module: ch02_random_variables.py · Notes: Random Variables

12 figures

Chapter 3. Expectation

Module: ch03_expectation.py · Notes: Expectation

6 figures

Chapter 4. Inequalities

Module: ch04_inequalities.py · Notes: Inequalities

7 figures

Chapter 5. Convergence of Random Variables

Module: ch05_convergence.py · Notes: Convergence of Random Variables

7 figures

Chapter 6. Models, Statistical Inference and Learning

Module: ch06_models_inference_learning.py · Notes: Models, Statistical Inference and Learning

6 figures

Chapter 7. Estimating the cdf and Statistical Functionals

Module: ch07_estimating_cdf.py · Notes: Estimating the cdf and Statistical Functionals

7 figures

Chapter 8. The Bootstrap

Module: ch08_bootstrap.py · Notes: The Bootstrap

8 figures

Chapter 9. Parametric Inference

Module: ch09_parametric_inference.py · Notes: Parametric Inference

10 figures

Chapter 10. Hypothesis Testing and p-values

Module: ch10_hypothesis_testing.py · Notes: Hypothesis Testing and p-values

11 figures

Chapter 11. Bayesian Inference

Module: ch11_bayesian_inference.py · Notes: Bayesian Inference

7 figures

Chapter 12. Statistical Decision Theory

Module: ch12_decision_theory.py · Notes: Statistical Decision Theory

9 figures

Chapter 13. Linear and Logistic Regression

Module: ch13_regression.py · Notes: Linear and Logistic Regression

9 figures

Chapter 14. Multivariate Models

Module: ch14_multivariate_models.py · Notes: Multivariate Models

6 figures

Chapter 15. Inference About Independence

Module: ch15_independence.py · Notes: Inference About Independence

5 figures

Chapter 16. Causal Inference

Module: ch16_causal_inference.py · Notes: Causal Inference

7 figures

Chapter 17. Directed Graphs and Conditional Independence

Module: ch17_directed_graphs.py · Notes: Directed Graphs and Conditional Independence

18 figures

Chapter 18. Undirected Graphs

Module: ch18_undirected_graphs.py · Notes: Undirected Graphs

18 figures

Chapter 19. Log-Linear Models

Module: ch19_log_linear_models.py · Notes: Log-Linear Models

9 figures

Chapter 20. Nonparametric Curve Estimation

Module: ch20_nonparametric_curve_estimation.py · Notes: Nonparametric Curve Estimation

14 figures

Chapter 21. Smoothing Using Orthogonal Functions

Module: ch21_orthogonal_functions.py · Notes: Smoothing Using Orthogonal Functions

20 figures

Chapter 22. Classification

Module: ch22_classification.py · Notes: Classification

14 figures

Chapter 23. Probability Redux: Stochastic Processes

Module: ch23_stochastic_processes.py · Notes: Probability Redux: Stochastic Processes

8 figures

Chapter 24. Simulation Methods

Module: ch24_simulation_methods.py · Notes: Simulation Methods

11 figures