You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extract the row_idx->unit survey-design collapse hand-rolled at four sites
(continuous_did.py event-study/overall/bootstrap SE + efficient_did.py
build-once) into two diff_diff/survey.py helpers:
- ResolvedSurveyDesign.subset_to_units_by_row_idx(row_idx, unit_weights=None):
folds the index-and-recount preamble around the existing subset_to_units.
- build_unit_first_row_index(unit_values, unit_order): first-panel-row index
per unit (replaces ContinuousDiD's slow df.iterrows() build and
EfficientDiD's inline .values scan).
Bit-identical: same np.unique + subset_to_units + arrays; survey-weighted SEs,
df_survey, and design-effect metadata are unchanged (oracle test locks it vs
the old inline logic). Removes ~95 lines of duplicated collapse.
StackedDiD is deliberately left on its own path (control units are duplicated
across sub-experiments, so it re-resolves at stacked granularity rather than
collapsing to one row per unit) with a clarifying comment; the residual
stacked-specific dedup is parked in TODO.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: TODO.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,6 @@ The `Origin` column (Actionable tables) and the `PR` column (Deferred tables) bo
28
28
29
29
| Issue | Location | Origin | Effort | Priority |
30
30
|-------|----------|--------|--------|----------|
31
-
| Survey-design resolution / collapse patterns are inconsistent across panel estimators — `ContinuousDiD` rebuilds unit-level design in SE code, `EfficientDiD` builds once in `fit()`, `StackedDiD` re-resolves on stacked data. Extract shared helpers for panel-to-unit collapse, post-filter re-resolution, and metadata recomputation. |`continuous_did.py`, `efficient_did.py`, `stacked_did.py`|#226| Mid | Low |
32
31
|`SyntheticControl` remaining ADH-2015 §4 items: the regression-weight `W^reg = X_0'(X_0 X_0')^{-1} X_1` extrapolation diagnostic (flag implied OLS weights outside `[0,1]`) and sparse-SC subset search (`l < J`, holding `V` fixed). LOO, in-time placebo, CV `V`-selection, and inverse-variance `V` have landed; these two are the deferred tail. |`synthetic_control.py`, `synthetic_control_results.py`| ADH-2015 | Mid | Low |
33
32
|`SyntheticControl` conformal (CWZ 2021) extensions: (a) one-sided / signed-`t` variants (§7); (b) covariates in the conformal proxy (`X_jt`, eqs 4/6 — current proxy is outcomes-only); (c) AR / innovation-permutation path (Lemmas 5-7) for time-series proxies. The joint test, pointwise CIs, and average-effect CI have landed. |`conformal.py`, `synthetic_control_results.py`| CWZ-2021 | Heavy | Low |
34
33
|`ContinuousDiD` CGBS-2024 extensions (matches R `contdid` v0.1.0 deferral set): (a) `covariates=` kwarg; (b) discrete-treatment saturated regression (integer dose currently warned, not routed to per-level coefficients); (c) lowest-dose-as-control per Remark 3.1 when `P(D=0)=0`. REGISTRY `## ContinuousDiD` → Implementation Checklist marks these `[ ]`. |`continuous_did.py`| CGBS-2024 | Heavy | Low |
@@ -123,6 +122,7 @@ Doable in principle, but no current caller and/or explicitly out of paper scope.
123
122
124
123
| Issue | Location | PR | Priority |
125
124
|-------|----------|----|----------|
125
+
|`StackedDiD` survey re-resolution intra-file dedup (raw-weight extraction ×3, compose-normalize ×3, resolve-on-stacked ×2). The cross-estimator ContinuousDiD/EfficientDiD panel-to-unit collapse consolidation LANDED (#226 shared helpers `ResolvedSurveyDesign.subset_to_units_by_row_idx` / `build_unit_first_row_index`); StackedDiD is deliberately NOT on that path (control units are duplicated across sub-experiments, so it re-resolves at stacked granularity rather than collapsing to one row per unit). The residual is stacked-specific, low value, and touches the numerically-sensitive composed-weight renormalization. Post-filter re-resolution / metadata-recompute unification across the three estimators was assessed and is not warranted — they use genuinely different mechanisms and already delegate to shared `_resolve_survey_for_fit` / `compute_survey_metadata`. |`stacked_did.py`|#226| Low |
126
126
| dCDH parity-test SE/CI assertions only cover pure-direction scenarios; mixed-direction SE comparison is structurally apples-to-oranges (cell-count vs obs-count weighting). |`test_chaisemartin_dhaultfoeuille_parity.py`|#294| Low |
127
127
|`HeterogeneousAdoptionDiD` survey-design API consolidation (**scheduled: next minor bump**): drop the deprecated `survey=` / `weights=` kwargs on all 8 HAD surfaces; only `survey_design=` remains. Also fold the legacy back-end `weights=` routing into the unified `_resolve_survey_for_fit` path. DeprecationWarning has shipped; the removal is ~50 LoC gated on the semver bump. |`had.py`, `had_pretests.py`| next minor | Medium |
128
128
|`HeterogeneousAdoptionDiD` joint cross-horizon covariance / sup-t bands: per-horizon SEs use independent sandwiches (paper-faithful pointwise CIs per Pierce-Schott Fig 2). Follow-ups (low demand): IF-based stacking for joint cross-horizon inference; analytical H×H covariance on the weighted ES path; a sup-t band on the unweighted ES path. |`had.py::_fit_event_study`| Phase 2b / 4.5 B | Low |
0 commit comments