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.
loss(
diagram_groups,
dist_mats,
dims,
p,
q,
distance,
sigma,
rho,
num_workers,
group_sizes
)
the numeric value of the Turner loss function.
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.
distance matrices between all possible pairs of persistence diagrams across and within groups storing the current distances which have been pre-computed.
a numeric vector of which homological dimensions in which the loss function is to be computed.
a number representing the wasserstein parameter, at least 1, and if Inf then the bottleneck distance is calculated.
a finite number at least 1.
a string which determines which type of distance calculation to carry out, either "wasserstein" (default) or "fisher".
the positive bandwidth for the persistence Fisher distance.
the approximation heuristic for Fisher information metric, results in sequential computation.
the number of cores used for parallel computation.
for when using precomputed distance matrices.
Shael Brown - shaelebrown@gmail.com
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.
Robinson T, Turner K (2017). "Hypothesis testing for topological data analysis." https://link.springer.com/article/10.1007/s41468-017-0008-7.