Commit b72c7b3
Implement observation-specific weights following paper Algorithm 2
This commit addresses the methodology review and aligns the TROP implementation
with the paper's specification (Athey, Imbens, Qu & Viviano 2025):
**Algorithm Changes:**
- Restructured fit() to follow Algorithm 2: for each treated (i,t), compute
observation-specific weights, fit model, compute τ̂_{it}, then average
- Changed unit distance from "average of treated" to pairwise RMSE between
each control unit j and specific treated unit i (Equation 3)
- Changed time distance from |s - (T - T_treat/2)| to simple |t - s| where
t is the specific treatment period (Equation 3)
- Added _compute_observation_weights() for per-(i,t) weight matrices
- Updated _loocv_score_obs_specific() to use observation-specific weights
- Updated bootstrap and jackknife variance methods accordingly
**New Methodology Tests:**
- test_limiting_case_uniform_weights: λ_unit = λ_time = λ_nn = 0 gives TWFE-like
- test_unit_weights_reduce_bias: unit weighting helps with heterogeneous controls
- test_time_weights_reduce_bias: time weighting helps with trending data
- test_factor_model_reduces_bias: nuclear norm helps with factor structure
- test_paper_dgp_recovery: validates against paper's Table 2 simulation DGP
**Performance Note:**
The per-observation model fitting is more computationally intensive but
provides the triple robustness property described in Theorem 5.1.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 34d9e41 commit b72c7b3
2 files changed
Lines changed: 543 additions & 156 deletions
0 commit comments