Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GATE and CATE for IRM models #169

Merged
merged 21 commits into from
Dec 23, 2022
Merged

Add GATE and CATE for IRM models #169

merged 21 commits into from
Dec 23, 2022

Conversation

SvenKlaassen
Copy link
Member

Description

Adding estimation of CATE and GATE for the IRM models based on the Semenova et al..

Implementation of a best linear predictor class DoubleMLBLP, which estimates an ols model for a given orthogonal signal and basis. The estimation is done via statsmodels.OLS, which implements the correct variance estimation.
The DoubleMLBLP includes a fit() method which estimates the coefficients and a confint() method, which creates the corresponding confidence intervals (and can be applied to a new basis vector to evaluate the best linear predictor on different values).

Additionally, the DoubleMLIRM class has been extended with the cate() and gate() methods.
Both, cate() and gate() create a DoubleMLIRMBLP object by obtaining the orthogonal signal from the DoubleMLIRM model and fitting the linear projection for the supplied basis. To obtain confidence intervals the confint() method has to be called.
For the gate() method confint() without supplying new values for the basis outputs the confidence interval reduced to the different groups.

Comments

Additional examples for the GATE and CATE estimation are available here and can be added to the documentation (maybe the DGPs can be changed).

PR Checklist

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

@SvenKlaassen SvenKlaassen added the new feature new feature label Nov 28, 2022
@PhilippBach
Copy link
Member

Hi @SvenKlaassen ,

thanks for opening the PR and I think overall it looks really good. I believe, this is a very nice and useful feature. Except for my comments I posted in my review, there's a little (minor) thing I wonder whether it would make the usage a bit nicer, i.e.

  • Add a method for string representation of the DoubleMLBLP class, i.e., __str__() that might give users some insight on the ... I'm wondering which information users might be relevant for users who calculated the CATE, I had in mind
    • Is the grid used for constructing the confidence interval / bands the same as the one used for estimating the CATE (in-sample vs. out-of-sample)
    • Is it a CATE or a GATE estimator
    • Maybe some information on the model used for fitting, like score etc
    • $\ldots$ (we can discuss this together)

However, this is not crucial as it's not related to the major functionality of the new feature. I guess adding examples that explain proper usage will make things clear, too.

Btw I also dropped the .coverage file in 9a18d06

@SvenKlaassen
Copy link
Member Author

Hi @PhilippBach,

thanks for the review. I have incorporated the changes, extenden the documentation and added a summary.

@PhilippBach
Copy link
Member

Hey @SvenKlaassen ,

I just updated the test jobs and merged them into this branch (➡️ a7263a4) to let the jobs run

The changes look good to me, so in general, this PR is ready to be merged. If all checks are passed, you can merge it 👍

@SvenKlaassen SvenKlaassen merged commit 0dcd89c into main Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants