-
Notifications
You must be signed in to change notification settings - Fork 60
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
Regression Discontinuity: add ability to specify bandwidth #226
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## main #226 +/- ##
==========================================
+ Coverage 70.40% 71.26% +0.85%
==========================================
Files 19 19
Lines 1007 1044 +37
==========================================
+ Hits 709 744 +35
- Misses 298 300 +2
|
if self.bandwidth is not None: | ||
fmin = self.treatment_threshold - self.bandwidth | ||
fmax = self.treatment_threshold + self.bandwidth | ||
filtered_data = self.data.query(f"{fmin} <= x <= {fmax}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we raise a warning when the bandwidth parameter makes the training set very small? Say less than 10 points?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea
Closes #225.
RegressionDiscontinuity
classes (both pymc and sci-kit learn) now accept an optionalbandwidth
kwarg.bandwidth
of the threshold.