DSC_bc: Barycenters in the DSC Method

Description Usage Arguments Value Examples

View source: R/DSC_bc.R

Description

Function for computing the barycenter in the DSC method at a specific time period.

Usage

1
DSC_bc(controls, weights, evgrid = seq(from = 0, to = 1, length.out = 1001))

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.

weights

a vector of weights for each control unit; can be calculated by DSC_weights.

evgrid

a vector of gridpoints used to evaluate quantile functions.

Value

DSC_bc returns a list containing the following components:

controls.q

a list of evaluated control unit quantile functions.

bc

a vector of evaluated barycenter.

Examples

1
2
3
4
5
6
7
8
#simulated data from Gaussian mixture
#ex_gmm() calls the simulated data
#detail can be found by ??ex_gmm
#obtaining the optimal weights
DSC_res=DSC_weights(ex_gmm()$control,ex_gmm()$target, M=100)
weights=DSC_res[[1]]
#obtaining the barycenter
DSC_bc(ex_gmm()$control,weights,seq(from=0,to=1,length.out=1001))

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