Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Rename TROP `method="twostep"` to `method="local"`; `"twostep"` deprecated, removal in v3.0
- Rename internal TROP `_joint_*` methods to `_global_*` for consistency

## [2.7.1] - 2026-03-15

### Changed
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ category (`Methodology/Correctness`, `Performance`, or `Testing/Docs`):
`threshold = 0.40 if n_boot < 100 else 0.15`.
- **`assert_nan_inference()`** from conftest.py: Use to validate ALL inference fields are
NaN-consistent. Don't check individual fields separately.
- **Slow tests**: TROP methodology/joint-method tests, Sun-Abraham bootstrap, and
- **Slow tests**: TROP methodology/global-method tests, Sun-Abraham bootstrap, and
TROP-parity tests are marked `@pytest.mark.slow` and excluded by default via `addopts`.
`test_trop.py` uses per-class markers (not file-level) so that validation, API, and
solver tests still run in the pure Python CI fallback. Run `pytest -m ''` to include
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ trop = TROP(

```python
TROP(
method='twostep', # Estimation method: 'twostep' (default) or 'joint'
method='local', # Estimation method: 'local' (default) or 'global'
lambda_time_grid=None, # Time decay grid (default: [0, 0.1, 0.5, 1, 2, 5])
lambda_unit_grid=None, # Unit distance grid (default: [0, 0.1, 0.5, 1, 2, 5])
lambda_nn_grid=None, # Nuclear norm grid (default: [0, 0.01, 0.1, 1, 10])
Expand All @@ -1530,8 +1530,8 @@ TROP(
```

**Estimation methods:**
- `'twostep'` (default): Per-observation model fitting following Algorithm 2 of the paper. Computes observation-specific weights and fits a model for each treated observation, then averages the individual treatment effects. More flexible but computationally intensive.
- `'joint'`: Joint weighted least squares optimization. Estimates a single scalar treatment effect τ along with fixed effects and optional low-rank factor adjustment. Faster but assumes homogeneous treatment effects.
- `'local'` (default): Per-observation model fitting following Algorithm 2 of the paper. Computes observation-specific weights and fits a model for each treated observation, then averages the individual treatment effects. More flexible but computationally intensive.
- `'global'`: Global weighted least squares optimization. Fits a single model on control observations with global weights, then computes per-observation treatment effects as residuals. Faster but uses global rather than observation-specific weights.

**Convenience function:**

Expand Down
32 changes: 16 additions & 16 deletions diff_diff/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
project_simplex as _rust_project_simplex,
solve_ols as _rust_solve_ols,
compute_robust_vcov as _rust_compute_robust_vcov,
# TROP estimator acceleration (twostep method)
# TROP estimator acceleration (local method)
compute_unit_distance_matrix as _rust_unit_distance_matrix,
loocv_grid_search as _rust_loocv_grid_search,
bootstrap_trop_variance as _rust_bootstrap_trop_variance,
# TROP estimator acceleration (joint method)
loocv_grid_search_joint as _rust_loocv_grid_search_joint,
bootstrap_trop_variance_joint as _rust_bootstrap_trop_variance_joint,
# TROP estimator acceleration (global method)
loocv_grid_search_global as _rust_loocv_grid_search_global,
bootstrap_trop_variance_global as _rust_bootstrap_trop_variance_global,
# SDID weights (Frank-Wolfe matching R's synthdid)
compute_sdid_unit_weights as _rust_sdid_unit_weights,
compute_time_weights as _rust_compute_time_weights,
Expand All @@ -46,13 +46,13 @@
_rust_project_simplex = None
_rust_solve_ols = None
_rust_compute_robust_vcov = None
# TROP estimator acceleration (twostep method)
# TROP estimator acceleration (local method)
_rust_unit_distance_matrix = None
_rust_loocv_grid_search = None
_rust_bootstrap_trop_variance = None
# TROP estimator acceleration (joint method)
_rust_loocv_grid_search_joint = None
_rust_bootstrap_trop_variance_joint = None
# TROP estimator acceleration (global method)
_rust_loocv_grid_search_global = None
_rust_bootstrap_trop_variance_global = None
# SDID weights (Frank-Wolfe matching R's synthdid)
_rust_sdid_unit_weights = None
_rust_compute_time_weights = None
Expand All @@ -69,13 +69,13 @@
_rust_project_simplex = None
_rust_solve_ols = None
_rust_compute_robust_vcov = None
# TROP estimator acceleration (twostep method)
# TROP estimator acceleration (local method)
_rust_unit_distance_matrix = None
_rust_loocv_grid_search = None
_rust_bootstrap_trop_variance = None
# TROP estimator acceleration (joint method)
_rust_loocv_grid_search_joint = None
_rust_bootstrap_trop_variance_joint = None
# TROP estimator acceleration (global method)
_rust_loocv_grid_search_global = None
_rust_bootstrap_trop_variance_global = None
# SDID weights (Frank-Wolfe matching R's synthdid)
_rust_sdid_unit_weights = None
_rust_compute_time_weights = None
Expand Down Expand Up @@ -118,13 +118,13 @@ def rust_backend_info():
'_rust_project_simplex',
'_rust_solve_ols',
'_rust_compute_robust_vcov',
# TROP estimator acceleration (twostep method)
# TROP estimator acceleration (local method)
'_rust_unit_distance_matrix',
'_rust_loocv_grid_search',
'_rust_bootstrap_trop_variance',
# TROP estimator acceleration (joint method)
'_rust_loocv_grid_search_joint',
'_rust_bootstrap_trop_variance_joint',
# TROP estimator acceleration (global method)
'_rust_loocv_grid_search_global',
'_rust_bootstrap_trop_variance_global',
# SDID weights (Frank-Wolfe matching R's synthdid)
'_rust_sdid_unit_weights',
'_rust_compute_time_weights',
Expand Down
Loading
Loading