computePS {TDAvec} | R Documentation |
A Vector Summary of the Persistence Silhouette Function
Description
Vectorizes the persistence silhouette (PS) function constructed from a given persistence diagram. The p
th power silhouette function of a persistence diagram D=\{(b_i,d_i)\}_{i=1}^N
is defined as
\phi_p(t) = \frac{\sum_{i=1}^N |d_i-b_i|^p\Lambda_i(t)}{\sum_{i=1}^N |d_i-b_i|^p},
where
\Lambda_i(t) = \left\{
\begin{array}{ll}
t-b_i & \quad t\in [b_i,\frac{b_i+d_i}{2}] \\
d_i-t & \quad t\in (\frac{b_i+d_i}{2},d_i]\\
0 & \quad \hbox{otherwise}
\end{array}
\right.
Points of D
with infinite death value are ignored
Usage
computePS(D, homDim, scaleSeq, p=1)
Arguments
D |
matrix with three columns containing the dimension, birth and death values respectively |
homDim |
homological dimension (0 for |
scaleSeq |
numeric vector of increasing scale values used for vectorization |
p |
power of the weights for the silhouette function. By default, |
Value
A numeric vector whose elements are the average values of the p
th power silhouette function computed between each pair of
consecutive scale points of scaleSeq
=\{t_1,t_2,\ldots,t_n\}
:
\Big(\frac{1}{\Delta t_1}\int_{t_1}^{t_2}\phi_p(t) dt,\frac{1}{\Delta t_2}\int_{t_2}^{t_3}\phi_p(t)dt,\ldots,\frac{1}{\Delta t_{n-1}}\int_{t_{n-1}}^{t_n}\phi_p(t)dt\Big),
where \Delta t_k=t_{k+1}-t_k
Author(s)
Umar Islambekov
References
1. Chazal, F., Fasy, B. T., Lecci, F., Rinaldo, A., & Wasserman, L. (2014). Stochastic convergence of persistence landscapes and silhouettes. In Proceedings of the thirtieth annual symposium on Computational geometry (pp. 474-483).
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
scaleSeq = seq(0,2,length.out=11) # sequence of scale values
# compute persistence silhouette (PS) for homological dimension H_0
computePS(D,homDim=0,scaleSeq,p=1)
# compute persistence silhouette (PS) for homological dimension H_1
computePS(D,homDim=1,scaleSeq,p=1)