diagram_kernel {TDApplied} | R Documentation |
Calculate persistence Fisher kernel value between a pair of persistence diagrams.
Description
Returns the persistence Fisher kernel value between a pair of persistence diagrams
in a particular homological dimension, each of which is either the output from a diagram_to_df
function call or from a persistent homology calculation like ripsDiag/calculate_homology
/PyH
.
Usage
diagram_kernel(D1, D2, dim = 0, sigma = 1, t = 1, rho = NULL)
Arguments
D1 |
the first persistence diagram. |
D2 |
the second persistence diagram. |
dim |
the non-negative integer homological dimension in which the distance is to be computed, default 0. |
sigma |
a positive number representing the bandwidth for the Fisher information metric, default 1. |
t |
a positive number representing the scale for the persistence Fisher kernel, default 1. |
rho |
an optional positive number representing the heuristic for Fisher information metric approximation, see |
Details
The persistence Fisher kernel is calculated from the Fisher information metric according to the formula
k_{PF}(D_1,D_2) = exp(-t*d_{FIM}(D_1,D_2))
, resembling a radial basis kernel for standard
Euclidean spaces.
Value
the numeric kernel value.
Author(s)
Shael Brown - shaelebrown@gmail.com
References
Le T, Yamada M (2018). "Persistence fisher kernel: a riemannian manifold kernel for persistence diagrams." https://proceedings.neurips.cc/paper/2018/file/959ab9a0695c467e7caf75431a872e5c-Paper.pdf.
Murphy, K. "Machine learning: a probabilistic perspective", MIT press (2012).
See Also
gram_matrix
for Gram (i.e. kernel) matrix calculations.
Examples
if(require("TDAstats"))
{
# create two diagrams
D1 <- TDAstats::calculate_homology(TDAstats::circle2d[sample(1:100,20),],
dim = 1,threshold = 2)
D2 <- TDAstats::calculate_homology(TDAstats::circle2d[sample(1:100,20),],
dim = 1,threshold = 2)
# calculate the kernel value between D1 and D2 with sigma = 2, t = 2 in dimension 1
diagram_kernel(D1,D2,dim = 1,sigma = 2,t = 2)
# calculate the kernel value between D1 and D2 with sigma = 2, t = 2 in dimension 0
diagram_kernel(D1,D2,dim = 0,sigma = 2,t = 2)
}