Internal R6 class object for Measure objects
balance_functionsthe functions of the data that we want to adjust towards the targets
balance_targetthe values the balance_functions are targeting
adaptWhat aspect of the data will be adapted. One of "none","weights", or "x".
devicethe torch::torch_device() of the data.
dtypethe torch::torch_dtype of the data.
nthe rows of the covariates, x.
dthe columns of the covariates, x.
probability_measureis the measure a probability measure?
gradgets or sets gradient
init_weightsreturns the initial value of the weights
init_datareturns the initial value of the data
requires_gradchecks or turns on/off gradient
weightsgets or sets weights
xGets or sets the data.
get_weight_parameters()Makes a copy of the weights parameters.
Measure_$get_weight_parameters()
...Not used
new()Constructor function
Measure_$new(
x,
weights = NULL,
probability.measure = TRUE,
adapt = c("none", "weights", "x"),
balance.functions = NA_real_,
target.values = NA_real_,
dtype = NULL,
device = NULL
)xThe data points
weightsThe empirical measure. If NULL, assigns equal weight to each observation
probability.measureIs the empirical measure a probability measure? Default is TRUE.
adaptShould we try to adapt the data ("x"), the weights ("weights"), or neither ("none"). Default is "none".
balance.functionsA matrix of functions of the covariates to target for mean balance. If NULL and target.values are provided, will use the data in x.
target.valuesThe targets for the balance functions. Should be the same length as columns in balance.functions.
dtypeThe torch::torch_dtype or NULL.
deviceThe device to have the data on. Should be result of torch::torch_device() or NULL.
clone()The objects of this class are cloneable with this method.
Measure_$clone(deep = FALSE)deepWhether to make a deep clone.