nuisance_cf: Cross-fitting of nuisance parameter with 'ensemble'.

View source: R/nuisance_parameters.R

nuisance_cfR Documentation

Cross-fitting of nuisance parameter with ensemble.

Description

Cross-fitting of nuisance parameter with ensemble.

Usage

nuisance_cf(
  ml,
  y,
  x,
  cf_mat,
  cv = 5,
  subset = NULL,
  weights = FALSE,
  path = NULL,
  quiet = TRUE
)

Arguments

ml

List of methods to be used in ensemble estimation. Methods can be created by create_method.

y

Vector of variable to be predicted.

x

Matrix of covariates.

cf_mat

Logical matrix with k columns of indicators representing the different folds (for example created by prep_cf_mat).

cv

Number of cross-validation when estimating ensemble (default 5).

subset

Optional logical vector if only subset of data should be used for prediction.

weights

If TRUE, prediction weights of the outcome nuisance extracted and saved (requires to provide a path).

path

Optional path to save the ensemble of each fold for later processing. Saved as path + "_foldi" where i is the fold number.

quiet

If FALSE, ensemble estimators print method that is currently running.

Value

Returns a n x 1 matrix of nuisance parameters.


MCKnaus/causalDML documentation built on Aug. 19, 2023, 5:47 p.m.