Learn R Programming

TDA (version 1.0)

ripsDiag: Rips Persitence Diagram

Description

This function computes the persistence diagram of the Rips filtration built on top of a point cloud.

Usage

ripsDiag(X, maxdimension, maxscale, dist = "euclidean", printStatus = 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$
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.
printStatus
logical: if TRUE, a progress bar is printed. Default is FALSE.

Value

  • ripsDiag returns an object of class diagram, a $P$ by 3 matrix, where $P$ is the number of points in the resulting persistence diagram. The first column contains the dimension of each feature (0 for components, 1 for loops, 2 for voids, etc.). Second and third columns are Birth and Death of the features.

Details

This function is an R wrapper of the function "rips-pairwise" of the C++ library Dionysus. See refereneces.

References

http://www.mrzv.org/software/dionysus/

Herbert Edelsbrunner and John Harer (2010), Computational topology: an introduction. American Mathematical Society.

Brittany Fasy, Fabrizio Lecci, Alessandro Rinaldo, Larry Wasserman, Sivaraman Balakrishnan, and Aarti Singh. (2013), "Statistical Inference For Persistent Homology", (arXiv:1303.7117). To appear, Annals of Statistics.

See Also

summary.diagram, plot.diagram, gridDiag

Examples

Run this code
## EXAMPLE 1: rips diagram for circles (euclidean distance)
XX = circleUnif(30)
DiagLim=5
maxdimension=1
## note that the input XX is a point cloud
Diag=ripsDiag(XX,maxdimension,DiagLim, printStatus=TRUE)


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

#rips diagram using the distance matrix as input
DiagLim=5
maxdimension=1
## note that the input distXX is a distance matrix
DiagTri=ripsDiag(distX,maxdimension,DiagLim, dist="arbitrary", printStatus=TRUE)
#points with lifetime=0 are not shown. e.g. the loop of the triangle.

Run the code above in your browser using DataLab