Skip to content

Fix placebo test examples in README documentation#19

Merged
igerber merged 2 commits intomainfrom
claude/validate-readme-examples-uRyan
Jan 3, 2026
Merged

Fix placebo test examples in README documentation#19
igerber merged 2 commits intomainfrom
claude/validate-readme-examples-uRyan

Conversation

@igerber
Copy link
Copy Markdown
Owner

@igerber igerber commented Jan 3, 2026

  • Fix fake_timing test: correct post_periods to [3,4,5] instead of [1,2]
  • Fix fake_group test: add unit parameter and use list of unit IDs
    instead of query string for fake_treatment_group
  • Fix permutation test: use binary 'post' column instead of 'period',
    add required 'unit' parameter
  • Fix leave_one_out test: use binary 'post' column instead of 'period'
  • Fix run_all_placebo_tests example: handle error dicts in results
    iteration, add note about binary post indicator requirement

claude added 2 commits January 3, 2026 20:23
- Fix fake_timing test: correct post_periods to [3,4,5] instead of [1,2]
- Fix fake_group test: add unit parameter and use list of unit IDs
  instead of query string for fake_treatment_group
- Fix permutation test: use binary 'post' column instead of 'period',
  add required 'unit' parameter
- Fix leave_one_out test: use binary 'post' column instead of 'period'
- Fix run_all_placebo_tests example: handle error dicts in results
  iteration, add note about binary post indicator requirement
- Update version in pyproject.toml to match __init__.py
- All 249 tests passing
- README documentation validated and fixed
@igerber igerber merged commit a72c2d7 into main Jan 3, 2026
@igerber igerber deleted the claude/validate-readme-examples-uRyan branch January 3, 2026 20:46
igerber added a commit that referenced this pull request Apr 19, 2026
…aths

Addresses findings #17, #18, #19 from the Phase 2 silent-failures audit (axis A,
all Minor). Each site previously ran np.linalg.solve against a matrix that
could be rank-deficient or near-singular with no user-facing signal.

- StaggeredTripleDifference: `_compute_did_panel` now appends a condition-number
  sample to an instance tracker on LinAlgError; `fit()` emits ONE aggregate
  UserWarning listing affected (g, g_c, t) cells and the max condition number
  instead of silently falling back to np.linalg.lstsq per pair. Tracker resets
  on repeat fit.
- EfficientDiD covariate sieve (estimate_propensity_ratio_sieve,
  estimate_inverse_propensity_sieve): precondition-check the normal-equations
  matrix via np.linalg.cond before solve and reject K values above
  1/sqrt(eps); partial-K skips now surface via UserWarning listing the
  skipped K values, instead of being swallowed by `continue`.
- compute_survey_vcov: check cond(X'WX) before the sandwich solve; emit
  UserWarning above the 1/sqrt(eps) threshold so ill-conditioned bread
  matrices don't silently produce unstable variance estimates.

Sibling sites picked up via repo-wide lstsq-fallback pattern grep (per
the pattern-check feedback memory):
- two_stage.py:1768 (TSL variance bread)
- two_stage_bootstrap.py:197 (multiplier bootstrap bread)
Both now warn before the silent lstsq fallback.

Adds 8 targeted tests across test_staggered_triple_diff.py,
test_efficient_did.py, and test_survey.py, covering collinear/ill-conditioned
triggers and happy-path negatives. REGISTRY.md notes added for each affected
estimator section. No behavioral change on well-conditioned inputs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants