Learn R Programming

grf (version 0.9.4)

instrumental_forest: Intrumental forest

Description

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.

Usage

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)

Arguments

X

The covariates used in the instrumental regression.

Y

The outcome.

W

The treatment assignment (may be binary or real).

Z

The instrument (may be binary or real).

sample.fraction

Fraction of the data used to build each tree. Note: If honesty is used, these subsamples will further be cut in half.

mtry

Number of variables tried for each split.

num.trees

Number of trees grown in the forest. Note: Getting accurate confidence intervals generally requires more trees than getting accurate predictions.

num.threads

Number of threads used in training. If set to NULL, the software automatically selects an appropriate amount.

min.node.size

Minimum number of observations in each tree leaf.

honesty

Should honest splitting (i.e., sub-sample splitting) be used?

ci.group.size

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.

precompute.nuisance

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.

split.regularization

Whether splits should be regularized towards a naive splitting criterion that ignores the instrument (and instead emulates a causal forest).

alpha

Maximum imbalance of a split.

lambda

A tuning parameter to control the amount of split regularization (experimental).

downweight.penalty

Whether or not the regularization penalty should be downweighted (experimental).

seed

The seed of the c++ random number generator.

Value

A trained instrumental forest object.