ripsFiltration: Rips Filtration

View source: R/ripsFiltration.R

ripsFiltrationR Documentation

Rips Filtration

Description

The function ripsFiltration computes the Rips filtration built on top of a point cloud.

Usage

ripsFiltration(
    X, maxdimension, maxscale, dist = "euclidean",
    library = "GUDHI", printProgress = FALSE)

Arguments

X

If dist="euclidean", X is an n by d matrix of coordinates, where n is the number of points in the d-dimensional euclidean space. If dist="arbitrary", X is an n by n matrix of distances of n points.

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.)

maxscale

number: maximum value of the rips filtration.

dist

"euclidean" for Euclidean distance, "arbitrary" for an arbitrary distance given in input as a distance matrix.

library

a string specifying which library to compute the Rips filtration. If dist = "euclidean", the user can use either the library "GUDHI" or "Dionysus". If dist = "arbitrary", the user can use the library "Dionysus". The default value is "GUDHI" if dist = "euclidean", and "Dionysus" if dist == "arbitrary". When "GUDHI" is used for dist = "arbitrary", "Dionysus" is implicitly used.

printProgress

logical: if TRUE, a progress bar is printed. The default value is FALSE.

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 use the C++ library Dionysus. See refereneces.

Value

The function ripsFiltration returns a list with the following elements:

cmplx

a list representing the complex. Its i-th element represents the vertices of i-th simplex.

values

a vector representing the filtration values. Its i-th element represents the filtration value of i-th simplex.

increasing

a logical variable indicating if the filtration values are in increasing order (TRUE) or in decreasing order (FALSE).

coordinates

only if dist = "euclidean": a matrix representing the coordinates of vertices. Its i-th row represents the coordinate of i-th vertex.

Author(s)

Jisu Kim

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.

See Also

ripsDiag, filtrationDiag

Examples

n <- 5
X <- cbind(cos(2*pi*seq_len(n)/n), sin(2*pi*seq_len(n)/n))
maxdimension <- 1
maxscale <- 1.5

FltRips <- ripsFiltration(X = X, maxdimension = maxdimension,
               maxscale = maxscale, dist = "euclidean", library = "GUDHI",
               printProgress = TRUE)

# plot rips filtration
lim <- rep(c(-1, 1), 2)
plot(NULL, type = "n", xlim = lim[1:2], ylim = lim[3:4],
    main = "Rips Filtration Plot")
for (idx in seq(along = FltRips[["cmplx"]])) {
  polygon(FltRips[["coordinates"]][FltRips[["cmplx"]][[idx]], , drop = FALSE],
      col = "pink", border = NA, xlim = lim[1:2], ylim = lim[3:4])
}
for (idx in seq(along = FltRips[["cmplx"]])) {
  polygon(FltRips[["coordinates"]][FltRips[["cmplx"]][[idx]], , drop = FALSE],
      col = NULL, xlim = lim[1:2], ylim = lim[3:4])
}  
points(FltRips[["coordinates"]], pch = 16)

TDA documentation built on May 29, 2024, 1:28 a.m.