The TDAvec
package provides implementations of several
vector summaries of persistence diagrams studied in Topological Data
Analysis (TDA). Each is obtained by discretizing the associated summary
function computed from a persistence diagram.
# install development version from GitHub
::install_github("alexey-luchinsky/TDAvec")
devtools
# install development version with vignettes/tutorials
::install_github("alexey-luchinsky/TDAvec", build_vignettes = TRUE) devtools
Example below shows how to use the computeVPB
function:
<- 100
N set.seed(123)
# sample N points uniformly from unit circle and add Gaussian noise
<- TDA::circleUnif(N,r=1) + rnorm(2*N,mean = 0,sd = 0.2)
X
# compute a persistence diagram using the Rips filtration built on top of X
<- TDA::ripsDiag(X,maxdimension = 1,maxscale = 2)$diagram
D
# switch from the birth-death to the birth-persistence coordinates
3] <- D[,3] - D[,2]
D[,colnames(D)[3] <- "Persistence"
# construct one-dimensional grid of scale values
<- unique(quantile(D[D[,1]==0,3],probs = seq(0,1,by=0.2)))
ySeqH0 <- 0.3 # parameter in [0,1] which controls the size of blocks around each point of the diagram
tau # compute VPB for homological dimension H_0
computeVPB(D,homDim = 0,xSeq=NA,ySeqH0,tau)
<- unique(quantile(D[D[,1]==1,2],probs = seq(0,1,by=0.2)))
xSeqH1 <- unique(quantile(D[D[,1]==1,3],probs = seq(0,1,by=0.2)))
ySeqH1 # compute VPB for homological dimension H_1
computeVPB(D,homDim = 1,xSeqH1,ySeqH1,tau)
More information can be found in the package vignette file or help pages of the other functions.
It you are using TDAvec
, consider citing the article
Chan, K. C., Islambekov, U., Luchinsky, A., & Sanders, R. (2022). A computationally efficient framework for vector representation of persistence diagrams. Journal of Machine Learning Research, 23, 1-33.