gap.clus: Gap statistics

View source: R/gap.clus.R View source: R/GCCclus.R

gap.clusR Documentation

Gap statistics

Description

This function computes the gap and the number of groups using the gap statistics.

Usage

gap.clus(DistanceMatrix, Clusters, B)

Arguments

DistanceMatrix

Square matrix of GCC distances.

Clusters

Matrix of member labels.

B

Number of iterations for the bootstrap.

Value

A list containing:

  • - optim.k: number of groups.

  • - gap.values: gap values.

References

Alonso, A. M. and Peña, D. (2019). Clustering time series by linear dependency. Statistics and Computing, 29(4):655–676.

Examples

data(TaiwanAirBox032017)
library(TSclust)
z <- diff(as.matrix(TaiwanAirBox032017[1:50,1:8]))
Macf <- as.matrix(diss(t(z), METHOD = "ACF", lag.max = 5))
sc1 <- hclust(as.dist(Macf), method = "complete")
memb <- cutree(sc1, 1:8)

ngroups <- gap.clus(Macf, memb, 100)



SLBDD documentation built on April 27, 2022, 5:08 p.m.

Related to gap.clus in SLBDD...