Skip to content

Fix IPW normalization in DoubleMLSSM - #428

Closed
suryaramku wants to merge 1 commit into
DoubleML:mainfrom
suryaramku:fix-ssm-ipw-normalization
Closed

suryaramku wants to merge 1 commit into
DoubleML:mainfrom
suryaramku:fix-ssm-ipw-normalization

Conversation

@suryaramku

Copy link
Copy Markdown

Description

This PR fixes the IPW normalization in DoubleMLSSM by replacing sum(dtreat) and sum(dcontrol) with the total sample size when calculating the treatment and control normalization factors.

Previously, the normalization incorrectly scaled the IPW residual corrections by the treatment and control group proportions. Under correctly specified propensity and selection models, the expected value of each unnormalized IPW weight is 1, so the normalization should use the total sample size rather than the number of observations in each treatment group.

Reference to Issues or PRs

Fixes #426

PR Checklist

Please fill out this PR checklist (see our contributing guidelines for details).

  • [ x] The title of the pull request summarizes the changes made.
  • [ x] The PR contains a detailed description of all changes and additions.
  • [ x] References to related issues or PRs are added.
  • [] The code passes all (unit) tests.
  • [] Enhancements or new feature are equipped with unit tests.
  • [x ] The changes adhere to the PEP8 standards.

Testing notes:

  • Ran python -m pytest doubleml/irm/tests/test_ssm.py -q
  • Result: 64 tests passed, 0 failed.
  • Full repository test suite has not been run.
  • This PR is a bug fix, not a new feature; no new regression tests have been added.

@SvenKlaassen

Copy link
Copy Markdown
Member

I will close this as this was already fixed in #427

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.

[Bug]: DoubleMLSSM with normalize_ipw=True scales the IPW correction by about P(D=d) instead of one

2 participants