ktaucenters_aux: ktaucenters_aux

Description Usage Arguments Value Note References See Also Examples

View source: R/ktaucenters_aux.R

Description

Robust Clustering algorithm based on centers, a robust and efficient version of KMeans.

Usage

1
ktaucenters_aux(X, K, centers, tolmin, NiterMax)

Arguments

X

A matrix of size n x p.

K

The number of clusters.

centers

matrix of size K x p containing the K initial centers, one at each matrix-row.

tolmin

tolerance parameter used for the algorithm stopping rule

NiterMax

a maximun number of iterations used for the algorithm stopping rule

Value

A list including the estimated K centers and labels for the observations

Note

Some times, if the initial centers are wrong, the algorithm converges to a non-optimal (local) solution. To avoid that, the algorithm must be run several times. This task is carried out by ktaucenters

References

Gonzalez, J. D., Yohai, V. J., & Zamar, R. H. (2019). Robust Clustering Using Tau-Scales. arXiv preprint arXiv:1906.08198.

See Also

ktaucenters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Generate Sintetic data (three cluster well separated)
Z=rnorm(600);
mues=rep(c(0,10,20),200)
X= matrix(Z+mues,ncol=2)

# Applying the algortihm
sal = ktaucenters_aux(
X, K=3, centers=X[sample(1:300,3), ],
tolmin=1e-3, NiterMax=100)

#plot the results
plot(X,type="n")
points(X[sal$cluster==1,],col=1);
points(X[sal$cluster==2,],col=2);
points(X[sal$cluster==3,],col=3);

ktaucenters documentation built on Aug. 3, 2019, 9:03 a.m.