Learn R Programming

TDApplied (version 3.0.3)

loss: Turner loss function for a list of groups (lists) of persistence diagrams.

Description

An internal function to calculate the normalized sum of within-group exponentiated distances between pairs of persistence diagrams (stored as data frames) for an arbitrary number of groups in parallel. Note that this function may run into memory issues for large numbers of diagrams.

Usage

loss(
  diagram_groups,
  dist_mats,
  dims,
  p,
  q,
  distance,
  sigma,
  rho,
  num_workers,
  group_sizes
)

Value

the numeric value of the Turner loss function.

Arguments

diagram_groups

groups (lists/vectors) of persistence diagrams, stored as lists of a data frame and an index of the diagram in all the diagrams across all groups.

dist_mats

distance matrices between all possible pairs of persistence diagrams across and within groups storing the current distances which have been pre-computed.

dims

a numeric vector of which homological dimensions in which the loss function is to be computed.

p

a number representing the wasserstein parameter, at least 1, and if Inf then the bottleneck distance is calculated.

q

a finite number at least 1.

distance

a string which determines which type of distance calculation to carry out, either "wasserstein" (default) or "fisher".

sigma

the positive bandwidth for the persistence Fisher distance.

rho

the approximation heuristic for Fisher information metric, results in sequential computation.

num_workers

the number of cores used for parallel computation.

group_sizes

for when using precomputed distance matrices.

Author

Shael Brown - shaelebrown@gmail.com

Details

The Turner loss function is described in Robinson and Turner 2017 (https://link.springer.com/article/10.1007/s41468-017-0008-7), and is used in the `permutation_test` function to describe how well-separated a particular grouping of persistence diagrams is. When the `distance` parameter is "fisher", `sigma` must not be NULL.

References

Robinson T, Turner K (2017). "Hypothesis testing for topological data analysis." https://link.springer.com/article/10.1007/s41468-017-0008-7.