Description Usage Arguments Value References See Also Examples
View source: R/homology_diagRips.R
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.
1 |
data |
a |
maxdim |
maximum dimension of the computed homological features (default: 1). |
threshold |
maximum value of the filtration (default: |
a dataframe object of S3 class "homology"
with following columns
dimension corresponding to a feature.
birth of a feature.
death of a feature.
wadhwa_tdastats_2018TDAkit
Ulrich Bauer (2019). “Ripser: Efficient Computation of Vietoris-Rips Persistence Barcodes.” arXiv:1908.02518.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # ---------------------------------------------------------------------------
# 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.