hpe: H+ discordance metric

Description Usage Arguments Value Examples

View source: R/hpe.R

Description

Estimates the H+ discordance metric for either (1) two sets (vectors) A and B, or (2) a dissimilarity matrix D and a label vector L. Approximation is calculated using p+1 percentiles, with an accuracy bound of 1/p.

Usage

1
hpe(A, B, D, L, p = 101, alg = "brute_force", alpha = F, gammas = F)

Arguments

A

numeric vector containing a set of length n

B

numeric vector containing a set of length n

D

distance matrix of dimension nxn

L

numeric or character vector of length n

p

integer representing the number of percentiles

alg

character string ("brute_force" or "grid_search") representing the choice of algorithm used to estimate H+

alpha

logical indicator to return alpha values that parameterize balance of within/between cluster distances

gammas

logical indicator to return estimate for gamma values that parameterize what %Dw is greater than a second %Db

Value

h is the estimated H+ value.

(optional) aw and ab (alphaW and alphaB) are (respectively) the portion of within- and between-cluster distances (or portional sizes of A and B)

(optional) gw and gb (gammaW and gammaB) are plausible ranges for gw100% of Dw (or A) are strictly greater than gw100% Db (or B)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
a <- rnorm(n=500, mean=0)
b <- rnorm(n=500 ,mean=1)
h <- hpe(A=a, B=b, p=101, alg="brute_force")

a <- sapply(1:500, function(i) rnorm(n=50, mean=0))
b <- sapply(1:500, function(i) rnorm(n=50, mean=0))
x <- cbind(a,b)
d <- dist(t(x))
l <- c(rep(0,500), rep(1,500))
h <- hpe(D=d, L=l, p=101, alg="brute_force")

fasthplus documentation built on Feb. 7, 2022, 5:16 p.m.