-
Notifications
You must be signed in to change notification settings - Fork 77
Propensity score Joint Estimation Versus 2 stage Estimation #500
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #500 +/- ##
==========================================
+ Coverage 94.59% 94.62% +0.03%
==========================================
Files 28 28
Lines 2053 2104 +51
==========================================
+ Hits 1942 1991 +49
- Misses 111 113 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:09Z Can you briefly describe what you want to compare, just to keep the storyline flow? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:10Z Can you please remove this output ? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:11Z @NathanielF Thank you for this simulation! I wanted to do this for years, and this makes everything very clear! |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:11Z Could you please add an explanation for this section? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:12Z Can you please add explanation on what these numbers represent (again, for the non-expert users) |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:12Z can you please remove this output? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:13Z Can you add explanation of this model comparison |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:13Z Again, can you please add some explanatory test here? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:14Z Can you please remove this output? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:14Z Can you please remove this output? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:15Z can you please add a watemark to get the package versions ? |
@NathanielF I love these examples 💪 ! Maybe you can ask Andrew Heiss or Jordan Nafa for feedback (maybe once we merge it so that this is not a blocker?) |
I left some minor comments about adding more explanatory tests is some sections. |
Thanks @juanitorduz ! Good idea to ask them. Appreciate the quick feedback!!! |
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Working on a draft PR to improve or augment the existing propensity scoring weighting implementation. In particular to make it a bit faster and more "Bayesian". As it currently stands we are performing a two-step strategy where we fit a propensity score model and then push the values of the posterior estimate for the propensity score through a re-weighting routine to estimate the causal contrast.
But we could try and explore a more properly Bayesian model where we fit the propensity score outcome and the model outcome at once in the same model context. This more properly Bayesian and a good bit faster.
See for instance, work here: https://github.com/ajnafa/Latent-Bayesian-MSM by Jordan Nafa and Andrew Heiss
---- EDIT ----
So i think i've finally understood the role of the propensity score in Bayesian estimation and I demonstrate that the two-stage method is what we actually want. The changes i've made are actually quite small. I've added a function to the PyMC model associated with the inverse propensity experiment class.
But in the notebook example i show why this two-stage process is to be preferred over the joint fit model.
📚 Documentation preview 📚: https://causalpy--500.org.readthedocs.build/en/500/