CateCI-MetaLearner: CateCI-MetaLearner

CateCI,CATEestimator-methodR Documentation

CateCI-MetaLearner

Description

Returns the estimated confidence intervals for the CATE.

Usage

## S4 method for signature 'CATEestimator'
CateCI(
  theObject,
  feature_new,
  method = "maintain_group_ratios",
  bootstrapVersion = "normalApprox",
  B = 2000,
  B_Second = B,
  nthread = 0,
  verbose = TRUE,
  aggregation = "oob"
)

Arguments

theObject

A 'MetaLearner' object.

feature_new

A feature data frame.

method

Different versions of the bootstrap.

bootstrapVersion

Default is normalApprox, which will use the bootstrap normal approximation to get CI. Smoothed will use CI around the smoothed bootstrap as introduced by Efron 2014. The third option is to use the doubleBootstrap option, which uses a double level bootstrap to calibrate the quantiles used in the bootstrap estimation of the intervals. For reference see https://arxiv.org/pdf/1511.00273.pdf, although this is an older algorithm which was introduced much earlier.

B

Number of bootstrap samples.

B_Second

Number of bootstrap samples to take in the second layer of the double bootstrap (the calibration samples). By default this is equal to B, however in practice we suggest using a slightly smaller value as the runtime is constrained by O(B * B_Second).

nthread

Number of threads to be used in parallel.

verbose

TRUE for detailed output, FALSE for no output.

Value

A data frame of estimated CATE confidence intervals.

Examples

## Not run: 
require(causalToolbox)

# create example data set
simulated_experiment <- simulate_causal_experiment(
  ntrain = 1000,
  ntest = 1000,
  dim = 10
)
feat <- simulated_experiment$feat_tr
tr <- simulated_experiment$W_tr
yobs <- simulated_experiment$Yobs_tr
feature_test <- simulated_experiment$feat_te

# create the CATE estimator using Random Forests (RF)
xl_rf <- X_RF(feat = feat, tr = tr, yobs = yobs)
CateCI(xl_rf, feature_test, B = 500)

## End(Not run)

forestry-labs/causalToolbox documentation built on Feb. 6, 2023, 11:27 p.m.