Measure_ {causalOT} | R Documentation |
An R6 object for measures
Description
Internal R6 class object for Measure objects
Public fields
balance_functions
the functions of the data that we want to adjust towards the targets
balance_target
the values the balance_functions are targeting
adapt
What aspect of the data will be adapted. One of "none","weights", or "x".
device
the
torch::torch_device()
of the data.dtype
the torch::torch_dtype of the data.
n
the rows of the covariates, x.
d
the columns of the covariates, x.
probability_measure
is the measure a probability measure?
Active bindings
grad
gets or sets gradient
init_weights
returns the initial value of the weights
init_data
returns the initial value of the data
requires_grad
checks or turns on/off gradient
weights
gets or sets weights
x
Gets or sets the data.
Methods
Public methods
Method detach()
generates a deep clone of the object without gradients.
Usage
Measure_$detach()
Method get_weight_parameters()
Makes a copy of the weights parameters.
Usage
Measure_$get_weight_parameters()
Method print()
prints the measure object
Usage
Measure_$print(...)
Arguments
...
Not used
Method new()
Constructor function
Usage
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 )
Arguments
x
The data points
weights
The empirical measure. If NULL, assigns equal weight to each observation
probability.measure
Is the empirical measure a probability measure? Default is TRUE.
adapt
Should we try to adapt the data ("x"), the weights ("weights"), or neither ("none"). Default is "none".
balance.functions
A matrix of functions of the covariates to target for mean balance. If NULL and
target.values
are provided, will use the data inx
.target.values
The targets for the balance functions. Should be the same length as columns in
balance.functions.
dtype
The torch::torch_dtype or NULL.
device
The device to have the data on. Should be result of
torch::torch_device()
or NULL.
Method clone()
The objects of this class are cloneable with this method.
Usage
Measure_$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.