Skip to content

Conversation

@TomeHirata
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings September 28, 2025 08:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the treatment indicator logic to support target treatment arms other than 1, enabling more flexible treatment effect estimation for multi-arm experiments.

  • Fixed treatment indicator logic in local treatment effects computation to correctly identify treatment/control groups
  • Added type annotations for better code clarity and IDE support
  • Improved vectorization in stratified distribution computation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
example/example.ipynb Consolidated function call parameters onto a single line
dte_adj/util.py Added type annotations and fixed treatment indicator logic using equality comparison
dte_adj/stratified.py Vectorized outcome comparison loop for improved efficiency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

)
d_c_prediction, d_c_psi, d_c_eta = estimator._compute_cumulative_distribution(
control_treatment_arm, np.zeros(1), X, Z, 1 - D
control_treatment_arm, np.zeros(1), X, Z, 1 - (target_treatment_arm == D)
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The treatment indicator logic is incorrect. For computing control treatment propensity, it should use 1 - (control_treatment_arm == D) instead of 1 - (target_treatment_arm == D) to properly identify control group membership.

Suggested change
control_treatment_arm, np.zeros(1), X, Z, 1 - (target_treatment_arm == D)
control_treatment_arm, np.zeros(1), X, Z, 1 - (control_treatment_arm == D)

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, current logic should be correct

@TomeHirata TomeHirata merged commit d283bf7 into main Sep 28, 2025
9 checks passed
@TomeHirata TomeHirata deleted the fix/treatment_indicator branch September 28, 2025 08:55
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