Unit 7 of 13 · about 3 hours · measure
Support, coverage, effective sample size and visitation diagnostics
Averages over data the policy never visits are guesses, not estimates. Support checks and visitation logs tell the difference before training burns time.
You'll be able to
- Compute effective sample size from importance weights and state when it signals collapse.
- Log state-action visitation from fixed trajectories and name uncovered pairs.
- Explain why no estimator or extra training fixes missing support.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Coverage and weight varianceReinforcement Learning: An Introduction (2nd ed.) - Chapters 2, 5, 6 and 7
Chapter 5, Sections 5.5 and 5.7: the coverage assumption on the behavior policy and the weighted-estimator variance discussion with Example 5.5 (printed pp. 103 to 111)
Read for support and variance only; control algorithms belong to other units.
- Loggable step fieldsGymnasium Core API
Env
stepreturningterminatedandtruncatedwithinfo, andresetwithseed: logobservation,action,reward,terminatedandtruncatedeach step (Gymnasium 1.4.0; page read 2026-10-14) - Visitation instrumentation in the control laboratoryReinforcement Learning Control Laboratory - Tabular Control
Milestone B and Measurement requirements: visitation records with per-seed raw curves
Focus on
- Support means wherever . Effective sample size drops toward when one weight dominates and equals for equal weights.
- Visitation counts come from logged trajectories, not from magnitudes. A large on an unvisited pair is initialization, not knowledge.
- Coverage is a property of the data-collection policy and the logging code. Changing the estimator cannot create visits that never happened.
Common mistakes · 3
- Reporting raw episode counts as coverage. Ten thousand episodes that avoid a pair still leave it uncovered.
- Averaging effective sample size across mismatched policies. Weights from different versions are not one sample; version the behavior policy first.
- Reading as success. Equal weights with tiny still leave large standard errors.
Try it yourself
Closed-book, before checking anything
[2.0, 0.5, 0.5, 1.0] and compute against , then flag a state-action pair with zero visits as uncovered in a small visitation table.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Weights are all equal. What is the effective sample size?Answer
. Each sample carries full weight.
2.One weight is 100 and ninety-nine are near zero. What does the size say?Answer
About 1. The average is effectively one trajectory.
3.A pair has zero visits but a high . What do you report?Answer
Uncovered. The value is initialization, not evidence.
4.Can weighted sampling fix zero support?Answer
No. Its ratio needs ; missing support means the estimand is unidentified from this data.
You're done when
You compute effective sample size on a weight vector without notes, produce a visitation table that names uncovered pairs, and refuse an estimate with missing support.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 4 more in the section
- Reinforcement Learning: An Introduction (2nd ed.) - Chapters 2, 5, 6 and 7Richard Sutton and Andrew Barto · primary
The authors post the full second edition free at incompleteideas.net; cite the printed page numbers. Study Sections 2.4 and 2.5 (incremental and constant step-size estimates), Chapter 5 without the starred sections (Monte Carlo prediction and control, ordinary and weighted importance sampling), Chapter 6 Sections 6.1 to 6.7 (TD(0), Sarsa, Q-learning, Expected Sarsa, maximization bias) and Chapter 7 Sections 7.1 to 7.3 (n-step methods). Reproduce Example 5.4 (off-policy blackjack), Example 6.2 (random walk) and Example 6.6 (cliff walking), and implement each update from fixed hand-calculated trajectories before training an agent.
- Gymnasium Core APIFarama Foundation · reference
Use the reset, step, seeding and wrapper documentation as the behavior authority for the installed environment version:
reset(seed=...)seeds once,stepreturnsterminatedandtruncated, and vector environments autoreset on the next step by default. Test observation, reward, terminated, truncated and info fields at the boundary. - Reinforcement Learning Control Laboratory - Tabular ControlRoadmap-Final · required
Complete the MC, SARSA and Q-learning requirements with exact trajectory updates, stochastic and exploration-sensitive environments, visitation logs, matched interaction budgets and seeded alignment and bootstrap defects.
Also in this section
- Stanford CS234 Winter 2026 - Policy Evaluation and Q-LearningStanford University · required
Study Lecture 3 (tabular policy evaluation) and Lecture 4 (Q-learning) slides and the relevant independent Assignment 1 and 2 written questions. Use the course treatment to state model-access, convergence, coverage and function-approximation assumptions for each update.
- Hands-on Modern RL - Dynamic Programming, Monte Carlo and TDWalking Labs · support
Use the DP, MC and TD page and the bandit script as a code companion. Rebuild the algorithms in the shared track schema, and keep the bandit comparison as a seed-sensitivity case: which method wins changes with the seed. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its
code/chapterNNfolders do not follow the site chapter numbers. - Deep-ML - Tabular Prediction and Control ProblemsDeep-ML · support
Use named problems as closed-book checks after your own implementation passes: 272 (first-visit Monte Carlo), 257 (TD error), 273 (n-step TD), 175 (SARSA), 476 (Expected SARSA), 133 (Q-learning) and 518 (cliff walking, SARSA versus Q-learning). Read each problem's tests before trusting its statement.
- Reinforcement Learning: An Introduction (2nd ed.) - Starred Sections 5.8 and 5.9 and Chapter 10 Sections 10.3 to 10.5Richard Sutton and Andrew Barto · support
Study starred Section 5.9 on per-decision importance sampling only for the per-decision estimator, and Chapter 10 Sections 10.3 to 10.5 on average reward and differential values only for the continuing-task unit. Cite printed pages; the authors post the full text free at incompleteideas.net.