Learn R Programming

D3M (version 0.41.1)

wasserMetric: Computing Wasserstein Metric

Description

Computing Wasserstein Metric

Usage

wasserMetric(cases, control, paranum = 101, q = 2)

Arguments

cases
name of case group data (matrix sample * feature).
control
names of control group data (matrix sample * feature).
paranum
the number of quatile discretization + 1. Default is discretized by 1%.
q
power of Wasserstein metric. Default is q = 2.

Value

vector of Wasserstein metric

Examples

Run this code
nrep <- 12
cases <- Map(rbeta,rep(30,nrep),rep(1,nrep),rep(5,nrep))
cases <- do.call("rbind",cases)
control <- Map(rbeta,rep(30,nrep),rep(1,nrep),rep(5,nrep))
control <- do.call("rbind",control)
wasserMetric(cases,control)

Run the code above in your browser using DataLab