crflynn / skgrf

scikit-learn compatible Python bindings for grf (generalized random forests) C++ random forest library
https://skgrf.readthedocs.io/en/stable/
GNU General Public License v3.0
30 stars 6 forks source link

ATE+Clustering #83

Open juamiji1 opened 2 years ago

juamiji1 commented 2 years ago

Hey! two questions:

  1. is there an analogous function to average_treatment_effect() in R?
  2. Does GRFForestCausalRegressor allows clustering?

Thanks!

crflynn commented 2 years ago
  1. No, not yet.
  2. It should! The fit params should allow you to pass a cluster array. ref
juamiji1 commented 2 years ago

Thanks for answering!

  1. is there a way you recommend to calculate it in a setup with observational data?
crflynn commented 2 years ago

I don't have a recommendation. The best thing would be to port the implementation from R into python, which lives here: https://github.com/grf-labs/grf/blob/ad1b781f2a9dec120eb6e5c03e6e111556f81ada/r-package/grf/R/average_treatment_effect.R

erikcs commented 2 years ago

If you are in a setting with binary W you can have a look at the first expression for Gamma https://grf-labs.github.io/grf/articles/muhats.html to understand what the code above is doing. If you have clusters specified you'd want to adjust your sample std. of Gamma for that.