DATA 8020 Course Assets

DATA 8020 Course Assets

This folder contains public course assets for DATA 8020: Advanced Causal Inference.

Contents

  • syllabus/: LaTeX source and compiled PDF for the syllabus.
  • project/: LaTeX source and compiled PDF for the final group project handout (rubrics, timeline, candidate topics).
  • lectures/lecture-01/: LaTeX sources and compiled PDFs for the Lecture 1 notes (lecture-01.tex) and beamer slides (lecture-01-slides.tex), plus downloaded images in figs/ (see figs/ATTRIBUTIONS.md for sources and licenses).
  • lectures/lecture-02/: LaTeX sources and compiled PDFs for the Lecture 2 notes (lecture-02.tex) and beamer slides (lecture-02-slides.tex) on causal languages and randomized experiments.
  • lectures/lecture-03/: LaTeX sources and compiled PDFs for Lecture 3 on observational studies, plus an executable Python notebook, transparent percent-format Python source, deterministic synthetic data, and generated diagnostic figures.
  • lectures/lecture-04/: LaTeX sources and compiled PDFs for Lecture 4 on double machine learning, plus an executable Python notebook, transparent percent-format source, deterministic data, Monte Carlo results, and generated diagnostics.
  • lectures/lecture-05/: LaTeX sources and compiled PDFs for Lecture 5 on heterogeneous treatment effects and CATE estimation, plus an executable Python notebook, transparent percent-format source, deterministic data, calibration and winner's-curse results, and generated figures.
  • lectures/lecture-06/: LaTeX sources and compiled PDFs for Lecture 6 on sequential decisions (policy learning, time-varying treatments, dynamic regimes, and a research-frontier survey), plus an executable Python notebook, transparent percent-format source, a deterministic two-visit registry, result tables, and generated figures.
  • references.bib: shared, verified BibTeX database used by all course PDFs.
  • tex/: shared LaTeX style files.

Build

Build all PDFs from this folder:

make

Clean LaTeX auxiliary files while keeping committed PDFs:

make clean

Lecture 3 notebook

The Lecture 3 computational companion requires Python 3.10 or later with numpy, pandas, matplotlib, scikit-learn, jupyter, and nbconvert. Run it from its lecture directory so generated figures remain under figs/:

cd lectures/lecture-03
jupyter nbconvert --to notebook --execute --inplace lecture-03-demo.ipynb

To regenerate the committed figures and CSVs from the percent-format source instead, force a non-interactive matplotlib backend:

cd lectures/lecture-03
MPLBACKEND=Agg python3 lecture-03-demo.py

The MPLBACKEND=Agg prefix matters. The script calls plt.show(), so on a machine with a GUI backend it opens a window and blocks partway through, leaving only the first two figures rewritten and no error on stdout.

The notebook and transplant-registry-observational.csv use constructed, deterministic data. They do not contain records from a real transplant program.

Lecture 4 notebook

The Lecture 4 companion uses the same dependencies and runs in about two minutes on the development machine. Run it from its lecture directory:

cd lectures/lecture-04
jupyter nbconvert --to notebook --execute --inplace lecture-04-demo.ipynb

If a user-level Jupyter configuration tries to load unavailable extensions, prefix the command with JUPYTER_CONFIG_DIR=/tmp/data8020-jupyter-config to run it with an isolated configuration.

The notebook, dml-transplant-registry.csv, and Monte Carlo results are constructed and deterministic. The default simulation is intentionally small enough for class use; increase the replication count only when a more stable simulation is needed.

Lecture 5 notebook

The Lecture 5 companion uses the same dependencies as Lectures 3 and 4 and runs in about 35 seconds on the development machine. Run it from its lecture directory:

cd lectures/lecture-05
jupyter nbconvert --to notebook --execute --inplace lecture-05-demo.ipynb

To regenerate the committed figures and CSVs from the percent-format source instead, force a non-interactive matplotlib backend:

cd lectures/lecture-05
MPLBACKEND=Agg python3 lecture-05-demo.py

The notebook builds two constructed registries that differ only in the true CATE: one where the effect is constant at two years for everyone, and one where it rises with severity. Both are deterministic and contain no records from a real transplant program. cate-transplant-registry.csv is the varying-effect registry with the ground-truth columns removed, so it can be analysed the way an observational analyst would see it.

Two details in the source are deliberate and should not be "simplified" away. The calibration test uses heteroskedasticity-robust standard errors because the AIPW pseudo-outcome has a heavy tail wherever the estimated propensity is small; with textbook homoskedastic errors the test returns a false positive on the constant-effect registry. The R-learner uses a linear working model, which is correctly specified for these data by construction, so its accuracy in the committed results table flatters it relative to the learners that assume nothing.

Lecture 6 notebook

The Lecture 6 companion uses the same dependencies as Lectures 3--5, plus scipy, which scikit-learn already installs. It runs in about five seconds on the development machine. Run it from its lecture directory:

cd lectures/lecture-06
jupyter nbconvert --to notebook --execute --inplace lecture-06-demo.ipynb

To regenerate the committed figures and CSVs from the percent-format source instead:

cd lectures/lecture-06
MPLBACKEND=Agg python3 lecture-06-demo.py

Regenerate the .ipynb from the .py source with jupytext --to ipynb lecture-06-demo.py.

All data are constructed and deterministic and contain no records from a real transplant program. sequential-transplant-registry.csv is the two-visit registry (severity, induction, rejection marker, escalation, survival) with no ground-truth columns; the true effect of always against never treating is 2.0 years, fixed in the source.

Two details are deliberate. The overlap-decay figure uses the true propensities, so the collapse of the effective sample size is a property of sustained strategies, not an estimation artefact. The curse-of-horizon figure labels its state-distribution curve as an oracle, because the density ratio is computed exactly rather than estimated.