computeNormalizedLife: A Vector Summary of the Normalized Life Curve

View source: R/RcppExports.R

computeNormalizedLifeR Documentation

A Vector Summary of the Normalized Life Curve

Description

For a given persistence diagram D=\{(b_i,d_i)\}_{i=1}^N (corresponding to a specified homological dimension), computeNormalizedLife() vectorizes the normalized life curve

sl(t)=\sum_{i=1}^N \frac{d_i-b_i}{L}\bold{1}_{[b_i,d_i)}(t),

where L=\sum_{i=1}^N (d_i-b_i), based on a scale sequence scaleSeq. The evaluation method depends on the argument evaluate. Points in D with infinite death values are ignored.

Usage

computeNormalizedLife(D, homDim, scaleSeq, evaluate = "intervals")

Arguments

D

a persistence diagram: a matrix with three columns containing the homological dimension, birth and death values respectively.

homDim

the homological dimension (0 for H_0, 1 for H_1, etc.). Rows in D are filtered based on this value.

scaleSeq

a numeric vector of increasing scale values used for vectorization.

evaluate

a character string indicating the evaluation method. Must be either "intervals" (default) or "points".

Details

The function extracts rows from D where the first column equals homDim, and computes values based on the filtered data and scaleSeq. If D does not contain any points corresponding to homDim, a vector of zeros is returned.

Value

A numeric vector containing elements computed using scaleSeq=\{t_1,t_2,\ldots,t_n\} according to the method specified by evaluate.

  • "intervals": Computes average values of the normalized life curve over intervals defined by consecutive elements in scaleSeq:

    \Big(\frac{1}{\Delta t_1}\int_{t_1}^{t_2}sl(t)dt,\frac{1}{\Delta t_2}\int_{t_2}^{t_3}sl(t)dt,\ldots,\frac{1}{\Delta t_{n-1}}\int_{t_{n-1}}^{t_n}sl(t)dt\Big)\in\mathbb{R}^{n-1},

    where \Delta t_k=t_{k+1}-t_k.

  • "points": Computes values of the normalized life curve at each point in scaleSeq:

    (sl(t_1),sl(t_2),\ldots,sl(t_n))\in\mathbb{R}^n.

Author(s)

Umar Islambekov

References

Chung, Y. M., & Lawson, A. (2022). Persistence curves: A canonical framework for summarizing persistence diagrams. Advances in Computational Mathematics, 48(1), 1-42.

Examples

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 normalized life curve for homological dimension H_0
computeNormalizedLife(D, homDim = 0, scaleSeq)

# Compute a vector summary of the normalized life curve for homological dimension H_1
computeNormalizedLife(D, homDim = 1, scaleSeq)

TDAvec documentation built on April 4, 2025, 1:37 a.m.