StoppingRules: Stopping rules for hierarchical cluster analysis

Description Usage Arguments Details Value Note Author(s) References Examples

Description

Examines several stopping rules included in the package NbClust and dynamicTreeCut and produce a matrix of partitions.

Usage

1
StoppingRules(dist, data, method = "average", rule = c("static", "dynamic", "optimal"))

Arguments

dist

A matrix of distances, given as a matrix, not as a dist object.

data

Data frame. The original data matrix, observations by variables (clusters of variables are created).

method

String. Method for hierarchical cluster analysis, for the moment only method "average" has been tested.

rule

String vector. Can include one or more of "static", "dynamic", "optimal". If "static" is present, the stopping rules implemented in the modified version of NbClust are included (they are very slow). If "dynamic" is present, the stopping rules in the package dynamicTreeCut are included, finally if "optimal"is present, the rules "easystop" and "optimal" are included

Details

The rule "easystop" means that the correct number of clusters is considered, the rule "optimal" means that the number of clusters with the highest value of adjusted rand index is considered.

Value

clusterings

A matrix of clusterings, an element by row, a stopping rule by column

values

A matrix of information on each stopping rule, its value or its parameters. A row by parameter, a column by stopping rule. Most values are NAs

Note

A large part of the code has been taken from package NbClust and has been modified to fit our necessities

Author(s)

Giulio Costantini

References

Langfelder, P., Zhang, B., & Horvath, S. (2008). Defining clusters from a hierarchical cluster tree: the Dynamic Tree Cut package for R. Bioinformatics, 24(5), 719-720. Milligan, G. W., & Cooper, M. C. (1985). An examination of procedures for determining the number of clusters in a data set. Psychometri, 50(2), 159-179.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
library(TOMproject)
N <- 10
N2 <- 30
m <- 15

# define a network
net <- Topology(N=N, m=m, topology="BA", exact.m=F, force.connected=T, negpro=0, pw_ba=1, minpcor=.1, maxpcor=.3)
pcm <- net$pcm
# assign clones
assi <- Assign(N=N, N2=N2, method_assign="pwr", shape1= .0001, shape2 = 1000)
assignments <- c()
for(i in 1:length(assi)) assignments <- c(assignments, rep(i, assi[i]))

# clone the network
cloned <- Clone(pcm=pcm, assi=assi, n=1000, furthersharedvar=.5, rndvar=.5, p=.9, keeporig=TRUE)

## TOMZhang and stopping rules
library(WGCNA)
dist <- TOMdist(adjMat=cor(cloned$cloned), TOMType="signed", TOMDenom="mean")
res <- StoppingRules(dist = dist, data = cloned$cloned, method = "average")

## End(Not run)

GiulioCostantini/TOMproject documentation built on May 6, 2019, 6:29 p.m.