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
P0 (observed-period detrending delta):
The R3 P1 fix made the slope LOOKUP use observed periods, but the
detrending DELTA (`t_rank - base_rank`) still pulled ranks from the
full categorical dtype via _build_period_rank. On panels with
unused intermediate categorical levels, the same observed data
produced different (t - base) multipliers and corrupted the
joint test statistic — silent wrong statistical output.
Fix: under trends_lin=True, build a fresh observed_rank dict from
sorted(set(data_filtered[time_col].unique())) and use it for both
the base and horizon ranks in the delta computation. Mirrors
HAD.fit's `_aggregate_multi_period_first_differences` convention
(`sorted(t_pre_list + t_post_list, ...)` for the event-time rank).
Both joint wrappers fixed; workflow inherits the fix automatically.
Regression tests (2):
- joint_pretrends_test on (categorical with 2 unused levels)
produces identical cvm_stat_joint and p_value to (categorical
without unused levels) on the same observed data
- joint_homogeneity_test twin invariant (unused level between
base and post)
P3 (exact upstream-version pin):
The parity contract cited DIDHAD v2.0.0 / SHA edc09197 in
CHANGELOG, REGISTRY, and the parity test docstrings, but the
generator and test only enforced `>= 2.0.0`. Future regeneration
could silently re-anchor goldens to a newer release while docs
still cited the old version.
Fix: pin exactly DIDHAD == 2.0.0 and YatchewTest == 1.1.1 in both
the generator's stopifnot guards and the parity test's metadata
assertion. Document the bump procedure in the comments.
Stats: 540 tests pass (538 prior + 2 new R4 P0 regressions), 0
regressions. All 24 R-parity cells still green at atol=1e-8 /
1e-10. Note: existing categorical-level invariance tests added in
R3 still pass — they exercised correctness on simple unused-level
shifts; the R4 invariants are stricter, asserting bit-exact
identity of the joint statistics across categorical re-ordering of
the same observed panel.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments