DSC_weights: Weights in the DSC Method

Description Usage Arguments Value Examples

View source: R/DSC_weights.R

Description

Function for obtaining the weights in the DSC method at a specific time period.

Usage

1
DSC_weights(controls, target, M = 500, choose_solver = "SCS")

Arguments

controls

a list or matrix: in list form, each list element contains a vector of observations for the given control unit; in matrix form, each column corresponds to one unit and each row is one observation.

target

a vector of observations.

M

an integer specifying the number of draws from the uniform distribution for approximating the integral.

choose_solver

a solver for the optimization problem; see installed_solvers in CVXR for more options.

Value

DSC_weights returns a list containing the following components:

weights

a matrix of the optimal weights.

distance

a float of the squared Wasserstein distance between the target and the corresponding barycenter.

Examples

1
2
3
4
#simulated data from Gaussian mixture
#ex_gmm() calls the simulated data
#detail can be found by ??ex_gmm
DSC_weights(ex_gmm()$control,ex_gmm()$target, M=100)

hesyserena/DSC documentation built on Dec. 20, 2021, 3:49 p.m.