cv.cdensity: Cross-validation for doubly robust estimation of...

Description Usage Arguments Value References Examples

View source: R/cv.cdensity.R

Description

cv.cdensity estimates counterfactual densities using linear cosine basis expansions at a sequence of dimensions, and then estimates the L2 pseudo-risk of each, which can be used for purposes of model selection. Nuisance functions are estimated with random forests.

Usage

1
2
cv.cdensity(y, a, x, kmax=5,
 gridlen=20, nsplits=2, progress_updates = TRUE)

Arguments

y

outcome of interest.

a

binary treatment (more than 2 levels are allowed, but only densities under A=1 and A=0 will be estimated).

x

covariate matrix.

kmax

Integer indicating maximum dimension of (cosine) basis expansion that should be used in series estimator.

gridlen

Integer number indicating length of grid for which the plug-in estimator of the marginal density is computed.

nsplits

Integer number of sample splits for nuisance estimation. If nsplits = 1, sample splitting is not used, and nuisance functions are estimated n full sample (in which case validity of standard errors and confidence intervals requires empirical process conditions). Otherwise must have nsplits > 1.

progress_updates

A logical value indicating whether to print a progress statement as various stages of computation reach completion. The default is TRUE, printing a progress bar to inform the user.

Value

A plot of the pseudo L2 risk of candidate estimators for counterfactual densities, at each model dimension from 1 to kmax

References

Kennedy EH, Wasserman LA, Balakrishnan S. Semiparametric counterfactual density estimation. arxiv:TBA

Examples

1
2
3
4
n <- 100; x <- matrix(rnorm(n*5),nrow=n)
a <- sample(3,n,replace=TRUE)-2; y <- rnorm(n)

cv.cdensity(y,a,x)

ehkennedy/npcausal documentation built on Feb. 26, 2021, 2:43 a.m.