computeEulerCharacteristic | R Documentation |
Vectorizes the Euler characteristic curve
\chi(t)=\sum_{k=0}^d (-1)^k\beta_k(t),
where \beta_0,\beta_1,\ldots,\beta_d
are the Betti curves corresponding to persistence diagrams D_0,D_1,\ldots,D_d
of dimensions 0,1,\ldots,d
respectively, all computed from the same filtration. The evaluation method depends on the argument evaluate
.
computeEulerCharacteristic(D, scaleSeq, maxhomDim = -1, evaluate = "intervals")
D |
a persistence diagram: a matrix with three columns containing the homological dimension, birth and death values respectively. |
scaleSeq |
a numeric vector of increasing scale values used for vectorization. |
maxhomDim |
the maximum homological dimension considered (0 for |
evaluate |
a character string indicating the evaluation method. Must be either |
A numeric vector containing elements computed using scaleSeq
=\{t_1,t_2,\ldots,t_n\}
according to the method specified by evaluate
. If D
does not contain any points corresponding to homDim
, a vector of zeros is returned.
"intervals"
: Computes average values of the Euler characteristic curve over intervals defined by consecutive elements in scaleSeq
:
\Big(\frac{1}{\Delta t_1}\int_{t_1}^{t_2}\chi(t)dt,\frac{1}{\Delta t_2}\int_{t_2}^{t_3}\chi(t)dt,\ldots,\frac{1}{\Delta t_{n-1}}\int_{t_{n-1}}^{t_n}\chi(t)dt\Big)\in\mathbb{R}^{n-1},
where \Delta t_k=t_{k+1}-t_k
.
"points"
: Computes values of the Euler characteristic curve at each point in scaleSeq
:
(\chi(t_1),\chi(t_2),\ldots,\chi(t_n))\in\mathbb{R}^n.
Umar Islambekov
1. Richardson, E., & Werman, M. (2014). Efficient classification using the Euler characteristic. Pattern Recognition Letters, 49, 99-106.
N <- 100 # The number of points to sample
set.seed(123) # Set a random seed for reproducibility
# Sample N points uniformly from the unit circle and add Gaussian noise
theta <- runif(N, min = 0, max = 2 * pi)
X <- cbind(cos(theta), sin(theta)) + rnorm(2 * N, mean = 0, sd = 0.2)
# Compute the persistence diagram using the Rips filtration built on top of X
# The 'threshold' parameter specifies the maximum distance for building simplices
D <- TDAstats::calculate_homology(X, threshold = 2)
scaleSeq = seq(0, 2, length.out = 11) # A sequence of scale values
# Compute a vector summary of the Euler characteristic curve
computeEulerCharacteristic(D, scaleSeq)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.