var_bn {uclust} | R Documentation |
Variance of Bn
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." Journal of Computational and Graphical Statistics 30(1) (2021).
Usage
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
Examples
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)