Trains an instrumental forest that can be used to estimate conditional local average treatment effects tau(X) identified using instruments. Formally, the forest estimates tau(X) = Cov[Y, Z | X = x] / Cov[W, Z | X = x]. Note that when the instrument Z and treatment assignment W coincide, an instrumental forest is equivalent to a causal forest.
instrumental_forest(X, Y, W, Z, sample.fraction = 0.5, mtry = ceiling(2 *
ncol(X)/3), num.trees = 2000, num.threads = NULL, min.node.size = NULL,
honesty = TRUE, ci.group.size = 2, precompute.nuisance = TRUE,
split.regularization = 0, alpha = 0.05, lambda = 0,
downweight.penalty = FALSE, seed = NULL)
The covariates used in the instrumental regression.
The outcome.
The treatment assignment (may be binary or real).
The instrument (may be binary or real).
Fraction of the data used to build each tree. Note: If honesty is used, these subsamples will further be cut in half.
Number of variables tried for each split.
Number of trees grown in the forest. Note: Getting accurate confidence intervals generally requires more trees than getting accurate predictions.
Number of threads used in training. If set to NULL, the software automatically selects an appropriate amount.
Minimum number of observations in each tree leaf.
Should honest splitting (i.e., sub-sample splitting) be used?
The forst will grow ci.group.size trees on each subsample. In order to provide confidence intervals, ci.group.size must be at least 2.
Should we first run regression forests to estimate y(x) = E[Y|X=x], w(x) = E[W|X=x] and z(x) = E[Z|X=x], and then run an instrumental forest on the residuals? This approach is recommended, computational resources permitting.
Whether splits should be regularized towards a naive splitting criterion that ignores the instrument (and instead emulates a causal forest).
Maximum imbalance of a split.
A tuning parameter to control the amount of split regularization (experimental).
Whether or not the regularization penalty should be downweighted (experimental).
The seed of the c++ random number generator.
A trained instrumental forest object.