nselectboot | R Documentation |
Selection of the number of clusters via bootstrap as explained in Fang and Wang (2012). Several times 2 bootstrap samples are drawn from the data and the number of clusters is chosen by optimising an instability estimation from these pairs.
In principle all clustering methods can be used that have a
CBI-wrapper, see clusterboot
,
kmeansCBI
. However, the currently implemented
classification methods are not necessarily suitable for all of them,
see argument classification
.
nselectboot(data,B=50,distances=inherits(data,"dist"),
clustermethod=NULL,
classification="averagedist",centroidname = NULL,
krange=2:10, count=FALSE,nnk=1,
largeisgood=FALSE,...)
data |
something that can be coerced into a matrix. The data
matrix - either an |
B |
integer. Number of resampling runs. |
distances |
logical. If |
clustermethod |
an interface function (the function name, not a
string containing the name, has to be provided!). This defines the
clustering method. See the "Details"-section of |
classification |
string.
This determines how non-clustered points are classified to given
clusters. Options are explained in |
centroidname |
string. Indicates the name of the component of
|
krange |
integer vector; numbers of clusters to be tried. |
count |
logical. If |
nnk |
number of nearest neighbours if
|
largeisgood |
logical. If |
... |
arguments to be passed on to the clustering method. |
nselectboot
returns a list with components
kopt,stabk,stab
.
kopt |
optimal number of clusters. |
stabk |
mean instability values for numbers of clusters (or one
minus this if |
stab |
matrix of instability values for all bootstrap runs and numbers of clusters. |
Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en/
Fang, Y. and Wang, J. (2012) Selection of the number of clusters via the bootstrap method. Computational Statistics and Data Analysis, 56, 468-477.
classifdist
, classifnp
,
clusterboot
,kmeansCBI
set.seed(20000)
face <- rFace(50,dMoNo=2,dNoEy=0,p=2)
nselectboot(dist(face),B=2,clustermethod=disthclustCBI,
method="average",krange=5:7)
nselectboot(dist(face),B=2,clustermethod=claraCBI,
classification="centroid",krange=5:7)
nselectboot(face,B=2,clustermethod=kmeansCBI,
classification="centroid",krange=5:7)
# Of course use larger B in a real application.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.