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

Parameter tuning for multi_arm_causal_forest #1195

Open
SONeill1999 opened this issue Aug 1, 2022 · 2 comments
Open

Parameter tuning for multi_arm_causal_forest #1195

SONeill1999 opened this issue Aug 1, 2022 · 2 comments

Comments

@SONeill1999
Copy link

Hello,
Thanks for your great package. I am interested in applying the multi_arm_causal_forest function, however I notice the tune.parameters option, available for other functions, does not seem to be an option here. I would appreciate any advice on how to tune the parameters in this context. I wonder if this option is likely to be added in future?
Thanks,
Stephen

@erikcs
Copy link
Member

erikcs commented Aug 2, 2022

Hi Stephen,

We haven't added tuning for this forest yet, it'll maybe be added at some point.

You can however assess model performance by calculating the implied loss (R-loss mentioned in the docstring) yourself. If forest is a trained multi-arm causal forest:

tau.hat <- predict(forest)$predictions[,,]
W.matrix <- model.matrix(~ forest$W.orig - 1)[, -1, drop = FALSE]
W.hat <- forest$W.hat[, -1]
Y.hat <- forest$Y.hat[, 1]
Y.orig <- forest$Y.orig[, 1]

residual <- Y.orig - (Y.hat + rowSums((W.matrix - W.hat) * tau.hat))
R.loss <- mean(residual^2)

Tuning essentially works by cross-validating on this criterion (and evaluating it on a held out sample). If you just want to try a few tuning parameters or compare with other estimators, then just computing and comparing this loss should be perfectly fine.

You may notice empirically that different R.loss's only differ in the last digits: that is expected since the treatment effect signal is dominated by noise. Stefan has a nice video lecture covering an example of this here.

@SONeill1999
Copy link
Author

SONeill1999 commented Aug 2, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants