Repository navigation
Add experimental native ChainedDiD for incomplete panels - #887
Draft
shawcharles wants to merge 1 commit into
Draft
shawcharles wants to merge 1 commit into
shawcharles wants to merge 1 commit into
Conversation
…anels Context: - Extend diff-diff to overlapping incomplete panels using within-unit changes, with a paper-derived algorithm and cdid as an external validation reference. Changes: - Add ChainedDiD and ChainedDiDResults with normalised pair IPW, never-treated controls, PT-post and fixed identity GMM; support static complete covariates. - Preserve original-unit accounting and provide analytical unit/cluster covariance, canonical aggregation, constituent weights and support diagnostics. - Add API/LLM documentation, executable tutorial, public exports, plotting integration, algebraic/reference tests and source-bound simulation evidence. - Retain failed coverage qualification and the known continuous-covariate R criterion difference. Sparse-pair pointwise intervals remain experimental. - Record the subsequent user-supplied numerical review; keep maintainer inference-policy and propensity-criterion decisions explicit before merge. - Exclude OR/DR, attrition correction, survey designs, optimal GMM, bootstrap and simultaneous bands. Preserve upstream 4.0.0 release metadata and dependencies. Verification: - Clean upstream contribution: default non-slow pytest suite, 15,619 passed and 291 skipped on CPython 3.14 with the local OpenBLAS backend available. - Focused estimator/reference/integration checks: 609 passed. - Minimum-version/reference checks: 111 passed each on Python 3.9 and 3.15. - Built and installed a local CPython 3.14 Linux/OpenBLAS wheel; isolated Python and Rust consumers agree exactly across four configurations, including aggregation, pickle and plotting checks. - Tutorial 34 executed; Sphinx with -W, Black and Ruff passed. - Independent submission review found no actionable packaging findings. - Subsequent user-supplied numerical review confirmed the bounded fixes but retained sparse-pair undercoverage and requested explicit merge decisions. - Submission wording and review-record correction only: previous execution logs retained; estimator code, tests and frozen evidence unchanged. - Not run: hosted/non-Linux CI, portable manylinux build, or fresh broad Monte Carlo qualification. Existing qualification failures remain documented.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add experimental native
ChainedDiDfor overlapping incomplete panels. It combines observed within-unit changes to recover group-time effects using normalised pair IPW, never-treated controls, PT-post and identity GMM. Results retain original-unit population accounting, analytical unit/cluster covariance, canonical aggregation and explicit support diagnostics.The methodology rests on Bellégo, Benatia and Dortet-Bernadet (2025), The chained difference-in-differences, Journal of Econometrics (DOI: 10.1016/j.jeconom.2024.105783). This contribution derives a restricted native Python estimator from that paper and uses
cdidas an external validation reference. Its implementation-specific safeguards and finite-sample limitations are documented below.The restricted contract includes static complete covariates and zero anticipation. Singleton comparisons are excluded, low support warns, mixed diagnostic event rows exclude structural reference zeros, and constituent cohort/date weights are available. OR/DR, attrition correction, survey designs, optimal GMM, simultaneous bands and bootstrap are outside this contribution.
Validation:
Normal pointwise inference remains experimental: supported sparse pairs can produce materially anti-conservative intervals despite the safeguards, and historical coverage qualification failures remain visible. This contribution makes no general finite-sample calibration or blanket R-parity claim. Hosted/non-Linux CI has not run; the configured PR jobs require the
ready-for-cilabel.The statistical contract, derivation and reproducible evidence are in
docs/methodology/chained-did-proposal.md,chained-did-pseudocode.md,chained-did-review-remediation.mdandchained-did-oracle-diagnostic.md; user-facing behaviour is indocs/api/chained_did.rst. The post-initial-review changes are singleton-pair exclusion, support warnings, mixed-reference aggregation and exposed constituent weights. The user-supplied numerical review of these changes is recorded indocs/methodology/chained-did-review-remediation.md#prepared-branch-review-2-november-2026; the separate packaging review did not assess numerical methodology.Before merge, maintainer decisions are required:
docs/methodology/chained-did-validation-followup.md.The contribution is ready for upstream review, but not ready to merge: these decisions and hosted CI remain outstanding. Statistical qualification remains false.