Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Related tracking surfaces:
| Conley bandwidth diagnostic: when `conley_cutoff_km` covers the whole treated set (one treated spatial cluster inside the bandwidth), the spatial-HAC meat collapses and the SE falls far below HC1 on data with no spatial correlation (tutorial 23's panel: HC1 0.117; Conley 0.117 at 0.5 km, 0.090 at 25 km, 0.062 at 100 km). This is the usual large-bandwidth HAC degeneracy, not a variance bug, but nothing warns. Candidate: a `UserWarning` when the share of treated-treated pairs inside the cutoff exceeds a threshold; the threshold needs a small simulation to choose. | `conley.py`, `spillover.py` | 4.0 tutorial review | Mid | Low |
| No public idiom for a static staggered TWFE with a time-varying covariate (`Y ~ D_it + X_it` with unit and calendar fixed effects): `TwoWayFixedEffects.fit` is 2x2-shaped in static mode and `decompose()` takes no covariates, so tutorial 33's "include the bad control" benchmark builds it from `within_transform` plus `solve_ols`. Either document that route as the supported one or add a staggered static mode. | `twfe.py`, `docs/tutorials/33_bad_controls.ipynb` | 4.0 tutorial review | Mid | Low |
| `SyntheticDiD` Frank-Wolfe convergence on an ordinary panel (tutorial 03: 3 treated and 40 control units, 14 periods, outcomes 30-80, noise sd 0.5): (1) `variance_method="bootstrap"` warns "Frank-Wolfe did not converge on 199 of 199 valid bootstrap draws" on the Rust backend, so the refit bootstrap cannot be shown warning-free and the tutorial demonstrates placebo and jackknife only; (2) on the pure-Python backend the placebo and jackknife fits warn "Frank-Wolfe SC weight solver did not converge in 100 iterations" and "... in 10000 iterations" where the Rust backend is silent on the same data and returns the same ATT. Establish whether the iteration cap or tolerance is too tight for refits, and why the two backends differ in what they report. Same family as the tutorial-18 row below. | `synthetic_did.py`, `utils.py`, `rust/src/` | 4.0 tutorial review | Mid | Low |
| `PreTrendsPower().fit(results)` with the default `M=None` evaluates power at the MDV itself, where it equals the target up to the integration error of the NIS box probability (`scipy.stats.multivariate_normal.cdf`, randomised Genz integration, about 1e-6, unseeded). `PreTrendsPowerResults.power_adequate` is `power >= target_power` with no tolerance, so on identical calls it comes out True or False at random (tutorial-07 panel: True in 14 of 30 fits, power 0.799991 to 0.800007), and `summary()` prints either "Power (80%) meets target" or "Power (80%) below target. Would need violations of 0.208" for the same fit. The MDV and every NIS power also jitter at that scale. Compare with a tolerance no smaller than the integration error (or treat the at-MDV evaluation as adequate by construction), and seed the integration so repeated calls agree. The Wald form is deterministic and unaffected. | `pretrends.py` | 4.0 tutorial review | Quick | Medium |

### Performance

Expand Down Expand Up @@ -111,6 +112,8 @@ generic sparse-FE, QR+SVD rank-detection redundancy, `check_finite` bypass — m
| Re-validate the plan-review dual engine on `gpt-6.1-sol` with `tools/plan-review-eval`: re-pin every arm's composite `cli_version` to the live Claude Code + codex CLI pair, add a gpt-6.1-sol arm, run the harness against the gpt-5.6-sol baseline (the 2026-10 swap carried the model over from the code-review campaign 2 verdict without a plan-review campaign). | `tools/plan-review-eval/config/configs.json` | reviewer-eval gpt61sol PR-2 | Heavy | Low |
| TWFE-weights tutorial section: `attgt_weights` (all three `type=` values side by side) + `decompose_twfe_weights` + `plot_twfe_weights` on `mpdta`, either as a section of `02_staggered_did.ipynb` or a new notebook registered in `docs/tutorials/index.rst`; follow-on PR by decision, the feature ships without it | `docs/tutorials/02_staggered_did.ipynb` | #812 | Mid | Medium |
| Geo-experiments tutorial: the SDiD fits on the `generate_factor_data(...)` panel (conversions ~1,500, sigma-hat ~310) hit the Frank-Wolfe iteration cap - the placebo fit warns once and the bootstrap cross-check warns on 100/100 draws - yet the narrative presents the bootstrap SE as a paper-faithful robustness check. Pre-existing on `main` under BOTH backends (surfaced when the notebook outputs were refreshed for the shape-only fit diagnostic); the committed April outputs predate the aggregated non-convergence warning. Either rescale / re-tune the DGP (or raise `max_iter` / loosen `min_decrease`) so the refits converge and re-execute, or label the bootstrap result unreliable and drop it from the "Validity evidence" claim. | `docs/tutorials/18_geo_experiments.ipynb` | local codex review of the SDiD shape-only fit-RMSE PR | Mid | Low |
| `PowerResults.summary()` and the `PowerAnalysis` / `compute_*` docstrings call the `sigma` input "Residual SD" / "Residual standard deviation" without saying residual of what, while the REGISTRY PowerAnalysis section calls it the outcome SD, with the `(1 - rho)` factor removing the within-unit part. A reader who passes a unit-fixed-effects residual SD and also sets `rho` double counts (tutorial 06 shows the arithmetic). State it once, the same way, on all three surfaces: the SD of the outcome around its group-period mean, unit component included. | `power.py` | 4.0 tutorial review | Quick | Low |
| `simulate_power` / `simulate_mde` / `simulate_sample_size`: `seed=` seeds the data generator only, so an estimator with its own resampling (`SyntheticDiD` placebo variance, bootstrap estimators) gives run-to-run different power, mean SE and coverage unless the estimator carries its own `seed` (tutorial 06: SDiD power 94-95% across identical calls until `SyntheticDiD(seed=42)`). Either derive a per-replicate estimator seed from the simulation seed when the estimator exposes `seed` and it is `None`, or say so in the three docstrings. | `power.py` | 4.0 tutorial review | Quick | Low |
| Replicate Chang (2020) §4.2.1 ML-design RCS DGP — requires a penalized (Lasso-class) propensity learner or a maintainer fixture via the duck-typed `propensity_learner=` object route; native logit+linear verified pure noise at (N=500, p=100) across ~20 review seeds (att ~ −23..+16, SE ~4-10, EPV ~1.4-1.6 vs threshold 10, fitted out-of-fold clipping ~5-29%, mean ~14%); at (N=200, p=100) `outcome_learner="linear"` fails closed on control-fold rank deficiency even under an oracle propensity (use ridge/sieve there); §4.2.2 is replicated | `tests/test_methodology_dml_did.py`, `diff_diff/_learners.py` | DML PR-B2 | Mid | Low |
| Optional scheduled end-to-end execution gate for the MMM tutorials (29/30): a cron-only workflow (or extension of `mmm-interop.yml`) that executes both notebooks in isolated exact-pin environments, so a stale/invalid committed posterior cannot stay green indefinitely - today the hybrid posture (deliberate: notebooks execute locally with committed outputs; CI smoke-tests the exporters without sampling; drift tests pin source + committed-output needles) leaves the MCMC claims un-re-executed in CI | `.github/workflows/mmm-interop.yml`, `docs/tutorials/29_mmm_calibration_pymc.ipynb`, `docs/tutorials/30_mmm_calibration_meridian.ipynb` | mmm-interop | Mid | Low |
| Committed `fixest::feols` event-study golden for TWFE `event_study=True` (within + pooled specs, unbalanced + covariate panels, matched CR1 cluster convention, per-period effects + vcov block) - the in-suite gate is the committed pre-refactor capture (`tests/fixtures/v4_twfe_event_study_oracles.json`, a self-capture of the shared core at 68e383bd/d45d5316), so a defect that predates the capture would pass; the live-R harness (`benchmarks/R/benchmark_multiperiod.R`, `feols(y ~ treated * time_f \| unit)`) validated the within design in `docs/benchmarks.rst` but is not a committed regression test - follow the `fixest_did_twfe_golden.json` committed-golden pattern (pytest.skip when absent) | `tests/test_fixest_did_twfe_parity.py`, `benchmarks/R/` | 3(a) R2 | Mid | Medium |
Expand Down
32 changes: 32 additions & 0 deletions changelog.d/20261125-tutorials-study-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### Documentation
- **Study-design tutorials repaired and brought to the tutorial conventions**
(`04_parallel_trends`, `05_honest_did`, `06_power_analysis`,
`07_pretrends_power`, `24_staggered_vs_collapsed_power`). Each now states
what it estimates and assumes before the first fit, checks results against a
stated truth, and is committed with executed outputs and a drift test.
Corrections of substance:
- `04`: pre-treatment diagnostics are presented as evidence, not as a
pass/fail gate; the group placebo passes `treatment=` so that treated
units are dropped (without it they sat in the placebo control group); the
permutation example no longer labels the placebo mean as the estimate.
- `05`: the relative-magnitudes restriction is stated on first differences,
as implemented (it was written on levels, which cannot reproduce the
output); the breakdown value is searched on a grid that reaches it; the
conventional interval is shown to miss the simulated truth where both
honest intervals cover it; relative magnitudes and smoothness are no
longer compared at "the same M"; `l_vec` and the staggered route are
shown.
- `06`: closed-form and simulated sample sizes are compared for the same
design (32 against 35 units, where the old comparison set 63 against 42
and blamed simulation noise); `sigma` and `rho` are defined once, with the
double-counting trap worked through; panel simulations cluster by unit.
- `07`: the linear minimum detectable violation is treated as a slope and
translated into the bias it implies, and is no longer passed to Honest DiD
as a smoothness bound; power grids sit on the scale of the MDV instead of
saturating at 100%; the form of the pre-test is named; a new section shows
by simulation that, in the notebook's design, bias is larger and coverage
lower among the samples that pass the pre-test.
- `24`: the removed `overall_att` name is gone from the prose; the event
study is drawn with `plot_event_study`; blanket warning filters are
removed (the fits are warning-free); the claim that the `simulate_*`
functions draw independently per estimator is corrected.
Loading
Loading