DSC_plot: Create a Plot for the Target Distribution and Barycenter

Description Usage Arguments Examples

View source: R/DSC_plot.R

Description

Create a plot for the target distribution (in black) and barycenter (in red).

Usage

1
2
3
4
5
6
7
DSC_plot(
  evgrid = seq(from = 0, to = 1, length.out = 1001),
  bc,
  target,
  y_name = "y",
  x_name = "x"
)

Arguments

evgrid

a vector of gridpoints used to evaluate quantile functions.

bc

a vector of evaluated barycenter; can be calculated by DSC_bc.

target

a vector of observations.

y_name

a string for the title of the y-axis.

x_name

a string for the title of the x-axis.

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]]
DSC_res2=DSC_bc(ex_gmm()$control,weights,seq(from=0,to=1,length.out=1001))
DSC_plot(bc=DSC_res2[[2]],target=ex_gmm()$target)

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