Skip to content

Remove jackknife variance estimation from TROP#124

Merged
igerber merged 1 commit intomainfrom
trop-remove-jacknife
Feb 1, 2026
Merged

Remove jackknife variance estimation from TROP#124
igerber merged 1 commit intomainfrom
trop-remove-jacknife

Conversation

@igerber
Copy link
Owner

@igerber igerber commented Feb 1, 2026

Summary

  • Remove variance_method parameter from TROP.__init__() and TROPResults dataclass
  • Delete _jackknife_variance() and _jackknife_variance_joint() methods (~180 lines)
  • Remove dispatch conditionals — bootstrap is now called directly
  • Update README, REGISTRY.md, tutorial notebook, and CHANGELOG

Breaking change: TROP(variance_method=...) now raises TypeError; TROPResults.variance_method no longer exists. Jackknife was never specified in the source paper — bootstrap is the only inference method described in Athey et al. (2025).

Methodology references (required if estimator / math changes)

  • Method name(s): TROP (Triply Robust Panel Estimator)
  • Paper / source link(s): Athey, S., Imbens, G. W., Qu, Z., & Viviano, D. (2025). Triply Robust Panel Estimators. https://arxiv.org/abs/2508.21536
  • Any intentional deviations from the source (and why): None — this change removes a deviation. Jackknife was an implementation addition not described in the paper. Bootstrap (Algorithm 3) is now the sole variance method, matching the paper exactly.

Validation

  • Tests added/updated: tests/test_trop.py — 4 jackknife tests deleted, 5 tests updated to remove variance_method kwarg. 80 tests pass.
  • Backtest / simulation / notebook evidence: docs/tutorials/10_trop.ipynb cells 24-25 rewritten for bootstrap-only variance.
  • Verified TROP(variance_method="bootstrap") raises TypeError (clean removal)
  • Verified trop() convenience function still works
  • Grepped codebase: no remaining TROP-specific jackknife/variance_method references

Security / privacy

  • Confirm no secrets/PII in this PR: Yes

Generated with Claude Code

Jackknife was never specified in the source paper (Athey et al. 2025);
bootstrap is the only variance method described. This removes the
variance_method parameter, both jackknife implementation methods, and
all related references from code, tests, and documentation.

Breaking change: TROP(variance_method=...) now raises TypeError;
TROPResults no longer has a variance_method field.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Overall Assessment

  • ✅ Looks good

Executive Summary

  • Jackknife removal is consistent across code paths; both joint and twostep now always use bootstrap for SEs. diff_diff/trop.py:L1486-L1524 diff_diff/trop.py:L2067-L2107
  • Methodology Registry now matches the paper: bootstrap-only inference for TROP. docs/methodology/REGISTRY.md:L548-L552 docs/methodology/REGISTRY.md:L972-L976
  • Docs/tests reflect the API change; examples no longer mention jackknife. README.md:L1871-L1916 tests/test_trop.py:L189-L236
  • Minor quality suggestion: consider validating n_bootstrap lower bounds now that bootstrap is mandatory.

Methodology

  • P3 — Alignment confirmed. Impact: None; bootstrap-only inference in code matches Methodology Registry and paper. Concrete fix: None. diff_diff/trop.py:L1486-L1524 diff_diff/trop.py:L2067-L2107 docs/methodology/REGISTRY.md:L548-L552

Code Quality

  • P3 — Consider validating n_bootstrap >= 2 (or warn) now that bootstrap is the sole variance path; otherwise SE can be 0/NaN with no explicit signal when reps are too small. Impact: Potential silent NaN inference if users set very low reps. Concrete fix: add a guard in TROP.__init__ or before bootstrapping to raise/warn on n_bootstrap < 2. diff_diff/trop.py:L452-L492 diff_diff/trop.py:L1486-L1524

Performance

  • P3 — No performance issues introduced in the diff. Impact: N/A. Concrete fix: N/A.

Maintainability

  • P3 — No maintainability concerns; removal simplifies inference branching. Impact: N/A. Concrete fix: N/A.

Tech Debt

  • P3 — No new tech debt identified. Impact: N/A. Concrete fix: N/A.

Security

  • P3 — No security issues found. Impact: N/A. Concrete fix: N/A.

Documentation/Tests

  • P3 — Optional: add a regression test that TROP(variance_method=...) raises TypeError to lock in the breaking change and prevent silent reintroduction via kwargs. Impact: Prevents accidental API drift. Concrete fix: add a small test in tests/test_trop.py. tests/test_trop.py:L236-L258

@igerber igerber merged commit 56633f7 into main Feb 1, 2026
8 checks passed
@igerber igerber deleted the trop-remove-jacknife branch February 1, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant