diagRips {TDAkit} | R Documentation |
Compute Vietoris-Rips Complex for Persistent Homology
Description
diagRips
computes the persistent diagram of the Vietoris-Rips filtration
constructed on a point cloud represented as matrix
or dist
object.
This function is a second-hand wrapper to TDAstats's wrapping for Ripser
library.
Usage
diagRips(data, maxdim = 1, threshold = Inf)
Arguments
data |
a |
maxdim |
maximum dimension of the computed homological features (default: 1). |
threshold |
maximum value of the filtration (default: |
Value
a dataframe object of S3 class "homology"
with following columns
- Dimension
dimension corresponding to a feature.
- Birth
birth of a feature.
- Death
death of a feature.
References
Raoul R. Wadhwa, Drew F.K. Williamson, Andrew Dhawan, Jacob G. Scott (2018). “TDAstats: R Pipeline for Computing Persistent Homology in Topological Data Analysis.” Journal of Open Source Software, 3(28), 860. ISSN 2475-9066.
Ulrich Bauer (2019). “Ripser: Efficient Computation of Vietoris-Rips Persistence Barcodes.” arXiv:1908.02518.
See Also
Examples
# ---------------------------------------------------------------------------
# Check consistency of two types of inputs : 'matrix' and 'dist' objects
# ---------------------------------------------------------------------------
# Use 'iris' data and compute its distance matrix
XX = as.matrix(iris[,1:4])
DX = stats::dist(XX)
# Compute VR Diagram with two inputs
vr.mat = diagRips(XX)
vr.dis = diagRips(DX)
col1 = as.factor(vr.mat$Dimension)
col2 = as.factor(vr.dis$Dimension)
# Visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2), pty="s")
plot(vr.mat$Birth, vr.mat$Death, pch=19, col=col1, main="from 'matrix'")
plot(vr.dis$Birth, vr.dis$Death, pch=19, col=col2, main="from 'dist'")
par(opar)