ripsDiag {TDA} | R Documentation |
Rips Persistence Diagram
Description
The function ripsDiag
computes the persistence diagram of the Rips filtration built on top of a point cloud.
Usage
ripsDiag(
X, maxdimension, maxscale, dist = "euclidean",
library = "GUDHI", location = FALSE, printProgress = FALSE)
Arguments
X |
If |
maxdimension |
integer: max dimension of the homological features to be computed. (e.g. 0 for connected components, 1 for connected components and loops, 2 for connected components, loops, voids, etc.)
Currently there is a bug for computing homological features of dimension higher than 1 when the distance is arbitrary ( |
maxscale |
number: maximum value of the rips filtration. |
dist |
|
library |
either a string or a vector of length two. When a vector is given, the first element specifies which library to compute the Rips filtration, and the second element specifies which library to compute the persistence diagram. If a string is used, then the same library is used. For computing the Rips filtration, if |
location |
if |
printProgress |
logical: if |
Details
For Rips filtration based on Euclidean distance of the input point cloud, the user can decide to use either the C++ library GUDHI or Dionysus.
For Rips filtration based on arbitrary distance, the user can decide to the C++ library Dionysus.
Then for computing the persistence diagram from the Rips filtration, the user can use either the C++ library GUDHI, Dionysus, or PHAT.
Currently there is a bug for computing homological features of dimension higher than 1 when the distance is arbitrary (dist = "arbitrary"
) and library 'GUDHI' is used (library = "GUDHI"
).
See refereneces.
Value
The function ripsDiag
returns a list with the following elements:
diagram |
an object of class |
birthLocation |
only if |
deathLocation |
only if |
cycleLocation |
only if |
Author(s)
Brittany T. Fasy, Jisu Kim, Fabrizio Lecci, and Clement Maria
References
Maria C (2014). "GUDHI, Simplicial Complexes and Persistent Homology Packages." https://project.inria.fr/gudhi/software/.
Morozov D (2007). "Dionysus, a C++ library for computing persistent homology". https://www.mrzv.org/software/dionysus/
Edelsbrunner H, Harer J (2010). "Computational topology: an introduction." American Mathematical Society.
Fasy B, Lecci F, Rinaldo A, Wasserman L, Balakrishnan S, Singh A (2013). "Statistical Inference For Persistent Homology." (arXiv:1303.7117). Annals of Statistics.
See Also
summary.diagram
, plot.diagram
, gridDiag
Examples
## EXAMPLE 1: rips diagram for circles (euclidean distance)
X <- circleUnif(30)
maxscale <- 5
maxdimension <- 1
## note that the input X is a point cloud
DiagRips <- ripsDiag(
X = X, maxdimension = maxdimension, maxscale = maxscale,
library = "Dionysus", location = TRUE, printProgress = TRUE)
# plot
layout(matrix(c(1, 3, 2, 2), 2, 2))
plot(X, cex = 0.5, pch = 19)
title(main = "Data")
plot(DiagRips[["diagram"]])
title(main = "rips Diagram")
one <- which(
DiagRips[["diagram"]][, 1] == 1 &
DiagRips[["diagram"]][, 3] - DiagRips[["diagram"]][, 2] > 0.5)
plot(X, col = 2, main = "Representative loop of data points")
for (i in seq(along = one)) {
for (j in seq_len(dim(DiagRips[["cycleLocation"]][[one[i]]])[1])) {
lines(
DiagRips[["cycleLocation"]][[one[i]]][j, , ], pch = 19, cex = 1,
col = i)
}
}
## EXAMPLE 2: rips diagram with arbitrary distance
## distance matrix for triangle with edges of length: 1,2,4
distX <- matrix(c(0, 1, 2, 1, 0, 4, 2, 4, 0), ncol = 3)
maxscale <- 5
maxdimension <- 1
## note that the input distXX is a distance matrix
DiagTri <- ripsDiag(distX, maxdimension, maxscale, dist = "arbitrary",
printProgress = TRUE)
#points with lifetime = 0 are not shown. e.g. the loop of the triangle.
print(DiagTri[["diagram"]])