TDDclust: Trimmed clustering based on L1 data depth

Description Usage Arguments Value Author(s) References Examples

View source: R/TDDclust.R

Description

This is the trimmed version of the clustering algorithm based on the L1 depth proposed by Rebecka Jornsten (2004). She segments all the observations in clusters, and assigns to each point z in the data space, the L1 depth value regarding its cluster. A trimmed procedure is incorporated to remove the more extreme individuals of each cluster (those one with the lowest depth values), in line with trimowa.

Usage

1
TDDclust(data,numClust,lambda,Th,niter,T0,simAnn,alpha,data1,verbose=TRUE)

Arguments

data

Data frame. Each row corresponds to an observation, and each column corresponds to a variable. All variables must be numeric.

numClust

Number of clusters.

lambda

Tuning parameter that controls the influence the data depth has over the clustering, see Jornsten (2004).

Th

Threshold for observations to be relocated, usually set to 0.

niter

Number of random initializations (iterations).

T0

Simulated annealing parameter. It is the current temperature in the simulated annealing procedure.

simAnn

Simulated annealing parameter. It is the decay rate, default 0.9.

alpha

Proportion of trimmed sample.

data1

The same data frame as data, used to incorporate the trimmed observations into the rest of them for the next iteration.

verbose

A logical specifying whether to provide descriptive output about the running process. Default TRUE.

Value

A list with the following elements:

NN: Cluster assignment, NN[1,] is the final partition.

cases: Anthropometric cases (the multivariate median cluster representatives).

DD: Depth values of the observations (only if there are trimmed observations).

Cost: Final value of the optimal partition.

discarded: Discarded (trimmed) observations.

klBest: Iteration in which the optimal partition was found.

Author(s)

This function has been defined from the original functions developed by Rebecka Jornsten, which were available freely on http://www.stat.rutgers.edu/home/rebecka/DDcl/. However, the link to this page doesn't currently exist as a result of a website redesign.

References

Jornsten R., (2004). Clustering and classification based on the L1 data depth, Journal of Multivariate Analysis 90, 67–89

Vinue, G., and Ibanez, M. V., (2014). Data depth and Biclustering applied to anthropometric data. Exploring their utility in apparel design. Technical report.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#In the interests of simplicity of the computation involved, only 15 points are selected:
dataTDDcl <- sampleSpanishSurvey[1 : 15, c(2, 3, 5)]  
dataTDDcl_aux <- sampleSpanishSurvey[1 : 15, c(2, 3, 5)]

numClust <- 3 ; alpha <- 0.01 ; lambda <- 0.5 ; niter <- 2
Th <- 0 ; T0 <- 0 ; simAnn <- 0.9  

#For reproducing results, seed for randomness:
#suppressWarnings(RNGversion("3.5.0"))
#set.seed(2014)
res_TDDcl <- TDDclust(dataTDDcl, numClust, lambda, Th, niter, T0, simAnn, 
                      alpha, dataTDDcl_aux,FALSE) 

prototypes <- anthrCases(res_TDDcl)

table(res_TDDcl$NN[1,]) 
res_TDDcl$Cost
res_TDDcl$klBest

trimmed <- trimmOutl(res_TDDcl)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

1 2 3 
6 6 3 
[1] 0.4826411
[1] 0

Anthropometry documentation built on Dec. 11, 2021, 9:08 a.m.