R/wasser.R

Defines functions wasserMetric

Documented in wasserMetric

#' Computing Wasserstein Metric
#' @param cases name of case group data (matrix sample * feature).
#' @param control names of control group data (matrix sample * feature).
#' @param paranum the number of quatile discretization + 1. Default is discretized by 1\%. 
#' @param q power of Wasserstein metric. Default is q = 2.
#' @return vector of Wasserstein metric
#' @author Yusuke Matsui & Teppei Shimamura
#' @examples
#' 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)
#' 
#' 
#' @export
#' 

wasserMetric <- function(cases,control,paranum = 101, q = 2){
  
  d <- wasserCpp_mat(cases,control,paranum = paranum, q = q)
  
  d
}

Try the D3M package in your browser

Any scripts or data that you put into this service are public.

D3M documentation built on May 30, 2017, 7:19 a.m.