Course · Python code

Python code that reproduces the figures

One module per chapter of Larsen and Marx, An Introduction to Mathematical Statistics and Its Applications (6th edition, 2018), with one function per figure, linked to the lecture notes. The code is written for this course in Python with numpy, scipy, pandas and matplotlib.

How to run it

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

The book's data tables are typed into small files in data/; everything else is simulated with fixed seeds. Each figure is written to img/chNN/ as PNG, SVG and PDF. Shared helpers are in common.py.

Chapter 1. Introduction: Lecture Notes

Module: ch01_introduction.py · Notes: Introduction: Lecture Notes

3 figures

Chapter 2. Probability

Module: ch02_probability.py · Notes: Probability

6 figures

Chapter 3. Random Variables: Lecture Notes

Module: ch03_random_variables.py · Notes: Random Variables: Lecture Notes

16 figures

Chapter 4. Special Distributions: Lecture Notes

Module: ch04_special_distributions.py · Notes: Special Distributions: Lecture Notes

13 figures

Chapter 5. Estimation: Lecture Notes

Module: ch05_estimation.py · Notes: Estimation: Lecture Notes

14 figures

Chapter 6. Hypothesis Testing: Lecture Notes

Module: ch06_hypothesis_testing.py · Notes: Hypothesis Testing: Lecture Notes

20 figures

Chapter 7. Inferences Based on the Normal Distribution: Lecture Notes

Module: ch07_normal_inference.py · Notes: Inferences Based on the Normal Distribution: Lecture Notes

13 figures

Chapter 8. Types of Data: A Brief Overview: Lecture Notes

Module: ch08_types_of_data.py · Notes: Types of Data: A Brief Overview: Lecture Notes

5 figures

Chapter 9. Two-Sample Inferences: Lecture Notes

Module: ch09_two_sample_inference.py · Notes: Two-Sample Inferences: Lecture Notes

6 figures

Chapter 10. Goodness-of-Fit Tests: Lecture Notes

Module: ch10_goodness_of_fit.py · Notes: Goodness-of-Fit Tests: Lecture Notes

7 figures

Chapter 11. Regression: Lecture Notes

Module: ch11_regression.py · Notes: Regression: Lecture Notes

18 figures

Chapter 12. The Analysis of Variance: Lecture Notes

Module: ch12_analysis_of_variance.py · Notes: The Analysis of Variance: Lecture Notes

6 figures

Chapter 13. Randomized Block Designs: Lecture Notes

Module: ch13_randomized_block_designs.py · Notes: Randomized Block Designs: Lecture Notes

3 figures
  • Own figure 13.1
  • Own figure 13.2
  • Own figure 13.3

Chapter 14. Nonparametric Statistics: Lecture Notes

Module: ch14_nonparametric_statistics.py · Notes: Nonparametric Statistics: Lecture Notes

11 figures