
Quantile-balanced causal forest for distributional treatment effects
Source:R/causal_forest_honest.R
morie_quantile_causal_forest.RdA quantile contrast is a mean contrast of an indicator, so the honest
forest runs on 1{Y <= q_tau}. A negative CDF contrast means
treatment pushes mass above the threshold, so shift_effect is its
negation. Mirrors morie.fn.qbcfgr.
Usage
morie_quantile_causal_forest(
y,
d,
x,
quantile = 0.5,
n_trees = 200L,
min_leaf = 15L,
seed = 0L
)References
Athey S, Tibshirani J, Wager S (2019). Generalized random forests. The Annals of Statistics 47(2), 1148-1178.
Examples
set.seed(4)
n <- 120
X <- matrix(rnorm(n * 2), n, 2)
d <- rbinom(n, 1, 0.5)
y <- 1 + X[, 1] + d * 0.8 + rnorm(n, 0, 0.3)
r <- morie_quantile_causal_forest(y, d, X, quantile = 0.5, n_trees = 20L)
str(r, max.level = 1)
#> List of 7
#> $ cdf_effect : num [1:120] -0.227 -0.227 -0.227 -0.227 -0.227 ...
#> $ shift_effect: num [1:120] 0.227 0.227 0.227 0.227 0.227 ...
#> $ threshold : num 1.37
#> $ quantile : num 0.5
#> $ ate_cdf : num -0.227
#> $ n : int 120
#> $ forest :List of 2