DS5030: Understanding Uncertainty
Probability and statistics for data science in the UVA MSDS program — distributions, simulation, the bootstrap, likelihood, and Bayesian inference.
DS 5030 is a graduate course in the UVA School of Data Science that picks up the threads of students’ math and probability education and builds a foundation for later work in machine learning and AI, grounded in data. Topics include linear algebra for data science, random variables and expectation, representing distributions (ECDFs, CDFs/PDFs, kernel density estimates), survival and hazard functions, sampling distributions, the bootstrap and the CLT, joint and conditional densities, Markov chains, maximum likelihood, regression and gradient descent, and Bayesian inference.
Each week has a Tuesday math day (concept-driven lecture and quiz) and a Thursday lab day (a coding lab that starts in class). Students fork a template repository and pull new lecture notebooks, labs, and datasets each week; the datasets for every notebook below are in that repo.
Getting set up
- Setup checklist: Anaconda, VS Code, Git, and forking the course repo [PDF]
- Day 1 Python test notebook [Notebook] [.ipynb]
- Background notebooks: [Data wrangling] [.ipynb] [GitHub and git] [.ipynb] [Probability] [.ipynb] [Vectors and matrices] [.ipynb]
Week 1: Introduction
- Introduction to the course [Lecture]
- Introduction to Python and GitHub [Lecture]
- Exploratory data analysis [Notebook] [.ipynb] [In-class version] [.ipynb]
- Interactive: What the sample mean minimizes
- Interactive: Why the sample variance undershoots (Bessel’s correction)
- Lab 01: Data wrangling and EDA [Notebook] [.ipynb] [Dataset catalog] [Data download script]
Week 2: Linear algebra
- Vectors and matrices [Slides] [Notebook] [.ipynb]
- Inner product and orthogonality [Slides] [Notebook] [.ipynb]
- Problem Set 1: Vectors and matrices [Notebook] [.ipynb] [Optional linear algebra references]
- From inner product to cosine similarity [Notebook] [.ipynb] [In-class version] [.ipynb]
- Interactive: Cosine similarity clock
- Lab 02: Spotify song recommendations with vector similarity [Notebook] [.ipynb] [In-class version] [.ipynb]
Week 3: Probability
- Probability and random variables [Slides] [Notebook] [.ipynb]
- Random variables and expectation [Slides] [Notebook] [.ipynb]
- Problem Set 2: Probability [PDF]
- Thursday recap: variance of dice rolls [Notebook] [.ipynb]
- Lab 03: Differential diagnosis and conditional probability with emergency department visits [Notebook] [.ipynb] [Codebook]
Week 4: Representing distributions
- Categorical variables and the ECDF [Slides] [Notebook] [.ipynb]
- Expectations and densities: the CDF and PDF [Slides] [Notebook] [.ipynb]
- Sampling and random numbers [Notebook] [.ipynb]
- Problem Set 3: Categorical variables and ECDFs [PDF]
- Lab 04: Generating CDFs from simulations [PDF]
- Interactive: Generating CDFs
Week 5: Density estimation and extreme events
- Kernel density estimation [Notebook] [.ipynb]
- Interactive: Density vs. cumulative
- Transcendentals and the Gaussian function [Notebook] [.ipynb]
- Problem Set 4: Kernel density estimation [Problems]
- Survival functions and hazard rates
- Interactive: Three shapes of risk
- Lab 05: Extreme events: distributions of the sample maximum and minimum [Notebook] [.ipynb]
Week 6: Sampling, bootstrapping, and the CLT
- Sampling distributions and estimator properties
- Interactive: One sample, one point [Skewed population] [Estimating variance]
- Interactive: How bad is my estimator? (Standard error)
- Interactive: Unbiased, but never consistent
- Bootstrapping [Notebook] [.ipynb] [Bootstrap game]
- A/B testing: D.A.R.E., Scared Straight, and other interventions [Notebook] [.ipynb]
- Lab 06: A/B testing and randomized controlled trials (ISCHEMIA-CKD and intra-aortic balloon pump trials) [Notebook] [.ipynb]
Midterm
Coming up
Two or more random variables (joint and conditional densities), Markov chains, likelihood and MLE, linear and logistic regression with gradient descent, and Bayesian inference. Materials will be added as the semester goes on.