computeVPB {TDAvec}R Documentation

A Vector Summary of the Persistence Block

Description

For a given persistence diagram D={(bi,pi)}i=1ND=\{(b_i,p_i)\}_{i=1}^N, computeVPB() vectorizes the persistence block

f(x,y)=i=1N1E(bi,pi)(x,y),f(x,y)=\sum_{i=1}^N \bold 1_{E(b_i,p_i)}(x,y),

where E(bi,pi)=[biλi2,bi+λi2]×[piλi2,pi+λi2]E(b_i,p_i)=[b_i-\frac{\lambda_i}{2},b_i+\frac{\lambda_i}{2}]\times [p_i-\frac{\lambda_i}{2},p_i+\frac{\lambda_i}{2}] and λi=2τpi\lambda_i=2\tau p_i with τ(0,1]\tau\in (0,1]. Points of DD with infinite persistence value are ignored

Usage

computeVPB(D, homDim, xSeq, ySeq, tau)

Arguments

D

matrix with three columns containing the dimension, birth and persistence values respectively

homDim

homological dimension (0 for H0H_0, 1 for H1H_1, etc.)

xSeq

numeric vector of increasing x (birth) values used for vectorization

ySeq

numeric vector of increasing y (persistence) values used for vectorization

tau

parameter (between 0 and 1) controlling block size. By default, tau=0.3

Value

A numeric vector whose elements are the weighted averages of the persistence block computed over each cell of the two-dimensional grid constructred from xSeq={x1,x2,,xn}\{x_1,x_2,\ldots,x_n\} and ySeq={y1,y2,,ym}\{y_1,y_2,\ldots,y_m\}:

(1Δx1Δy1[x1,x2]×[y1,y2]f(x,y)wdA,,1Δxn1Δym1[xn1,xn]×[ym1,ym]f(x,y)wdA),\Big(\frac{1}{\Delta x_1\Delta y_1}\int_{[x_1,x_2]\times [y_1,y_2]}f(x,y)wdA,\ldots,\frac{1}{\Delta x_{n-1}\Delta y_{m-1}}\int_{[x_{n-1},x_n]\times [y_{m-1},y_m]}f(x,y)wdA\Big),

where wdA=(x+y)dxdywdA=(x+y)dxdy, Δxk=xk+1xk\Delta x_k=x_{k+1}-x_k and Δyj=yj+1yj\Delta y_j=y_{j+1}-y_j

Author(s)

Umar Islambekov, Aleksei Luchinsky

References

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

Examples

N <- 100 
set.seed(123)
# sample N points uniformly from unit circle and add Gaussian noise
X <- TDA::circleUnif(N,r=1) + rnorm(2*N,mean = 0,sd = 0.2)

# compute a persistence diagram using the Rips filtration built on top of X
D <- TDA::ripsDiag(X,maxdimension = 1,maxscale = 2)$diagram 

# switch from the birth-death to the birth-persistence coordinates
D[,3] <- D[,3] - D[,2] 
colnames(D)[3] <- "Persistence"

# construct one-dimensional grid of scale values
ySeqH0 <- unique(quantile(D[D[,1]==0,3],probs = seq(0,1,by=0.2))) 
tau <- 0.3 # parameter in [0,1] which controls the size of blocks around each point of the diagram 
# compute VPB for homological dimension H_0
computeVPB(D,homDim = 0,xSeq=NA,ySeqH0,tau)

xSeqH1 <- unique(quantile(D[D[,1]==1,2],probs = seq(0,1,by=0.2)))
ySeqH1 <- unique(quantile(D[D[,1]==1,3],probs = seq(0,1,by=0.2)))
# compute VPB for homological dimension H_1
computeVPB(D,homDim = 1,xSeqH1,ySeqH1,tau) 

[Package TDAvec version 0.1.3 Index]