var_bn: Variance of Bn

Description Usage Arguments Details Value See Also Examples

Description

Estimates the variance of the Bn statistic using the resampling procedure described in Cybis, Gabriela B., Marcio Valk, and Sílvia RC Lopes. "Clustering and classification problems in genetics through U-statistics." Journal of Statistical Computation and Simulation 88.10 (2018) and Valk, Marcio, and Gabriela Bettella Cybis. "U-statistical inference for hierarchical clustering." arXiv preprint arXiv:1805.12179 (2018).

Usage

1
var_bn(group_sizes, md = NULL, data = NULL, numB = 2000)

Arguments

group_sizes

A vector with two entries: size of group 1 and size of group 2.

md

Matrix of distances between all data points.

data

Data matrix. Each row represents an observation.

numB

Number of resampling iterations. Only used if no groups are of size 1.

Details

Either data or md should be provided. If data are entered directly, Bn will be computed considering the squared Euclidean distance, which is compatible with is_homo, uclust and uhclust.

Value

Variance of Bn

See Also

bn

Examples

1
2
3
4
5
6
7
8
n=5
x=matrix(rnorm(n*20),ncol=20)
# option (a) entering the data matrix directly and considering a group of size 1
var_bn(c(1,4),data=x)

# option (b) entering the distance matrix and considering a groups of size 2 and 3
md=as.matrix(dist(x))^2
var_bn(c(2,3),md)

gcybis/Uclust documentation built on May 8, 2019, 1:20 p.m.