Learn R Programming

TDA (version 1.9.1)

silhouette: The Persistence Silhouette Function

Description

The function silhouette computes the silhouette function corresponding to a given persistence diagram.

Usage

silhouette(
    Diag, p = 1, dimension = 1, 
    tseq = seq(min(Diag[, 2:3]), max(Diag[, 2:3]), length = 500))

Value

The function silhouette returns a numeric matrix of with the number of row as the length of tseq and the number of column as the length of p. The value at ith row and jth column represents the value of the p[j]-th power silhouette function evaluated at tseq[i].

Arguments

Diag

an object of class diagram or a \(P\) by \(3\) matrix, storing a persistence diagram with colnames: "dimension", "Birth", "Death".

p

a vector: the power of the weights of the silhouette function. See the definition of silhouette function, Section 5 in the reference.

dimension

the dimension of the topological features under consideration. The default value is 1 (loops).

tseq

a vector of values at which the silhouette function is evaluated.

Author

Fabrizio Lecci

References

Chazal F, Fasy BT, Lecci F, Rinaldo A, Wasserman L (2014). "Stochastic Convergence of Persistence Landscapes and Silhouettes." Proceedings of the 30th Symposium of Computational Geometry (SoCG). (arXiv:1312.0308)

See Also

landscape

Examples

Run this code
Diag <- matrix(c(0, 0, 10, 1, 0, 3, 1, 3, 8), ncol = 3, byrow = TRUE)
DiagLim <- 10
colnames(Diag) <- c("dimension", "Birth", "Death")

#persistence silhouette
tseq <- seq(0, DiagLim, length = 1000)
Sil <- silhouette(Diag, p = 1,  dimension = 1, tseq)

par(mfrow = c(1, 2))
plot.diagram(Diag)
plot(tseq, Sil, type = "l", xlab = "t", ylab = "silhouette", asp = 1)

Run the code above in your browser using DataLab