Cross-validated conditional density estimation with HAL

haldensify(
  A,
  W,
  wts = rep(1, length(A)),
  grid_type = c("equal_range", "equal_mass"),
  n_bins = c(5, 10),
  lambda_seq = exp(seq(-1, -13, length = 1000)),
  use_future = FALSE,
  seed_int = 791L
)

Arguments

A

The numeric vector or similar of the observed values of an intervention for a group of observational units of interest.

W

A data.frame, matrix, or similar giving the values of baseline covariates (potential confounders) for the observed units whose observed intervention values are provided in the previous argument.

wts

A numeric vector of observation-level weights. The default is to weight all observations equally.

grid_type

A character indicating the strategy (or strategies) to be used in creating bins along the observed support of the intervention A. For bins of equal range, use "equal_range"; consult documentation of cut_interval for more information. To ensure each bin has the same number of points, use "equal_mass"; consult documentation of cut_number for details.

n_bins

Only used if type is set to "equal_range" or "equal_mass". This numeric value indicates the number(s) of bins into which the support of the intervention A is to be divided.

lambda_seq

A numeric sequence of values of the tuning parameter of the Lasso L1 regression passed to fit_hal.

use_future

A logical indicating whether to attempt to use parallelization based on the future and future.apply packages. If set to TRUE, future_mapply will be used in place of mapply. When set to TRUE, a parallelization scheme must be set externally by using plan.

seed_int

An integer used to set the seed in the cross-validation procedure used to select binning values. This numeric is passed to argument future.seed of future_mapply.