2.4.6. Magnitude
This module is related to calculation of the magnitude. Some relevant links and references are below.
Tom Leinster, The magnitude of metric spaces. Doc. Math. 18 (2013), pp. 857-905. doi: 10.4171/DM/415.
Miguel O’Malley, Sara Kalisnik, Nina Otter. Alpha magnitude. Journal of Pure and Applied Algebra, Volume 227, Issue 11,2023, doi: 10.1016/j.jpaa.2023.107396.
2.4.6.1. Magnitude function
This module provides algorithms related to computing the magnitude. See paper below for additional details
Miguel O’Malley, Sara Kalisnik, Nina Otter. Alpha magnitude. Journal of Pure and Applied Algebra, Volume 227, Issue 11,2023, doi: 10.1016/j.jpaa.2023.107396.
- teaspoon.TDA.Magnitude.MagnitudeFunction(D, t_range=[0.1, 10], t_n=100)[source]
This function calculates the magnitude function,
t -> |tX|
, of an input distance matrix assumed to be calculated from a finite metric spaceX
, on the interval defined by t_range at t_n locations.Given a finite metric space
(X,d)
and for matrix purposes, fix an order on the pointsx_1,\cdots,x_n
.Denote the distance matrix by
D=[d(x_i,x_j)]_{ij}=[D_{ij}]_{ij}
Denote the similarity matrix
Z=Z_X
to have entriesZ_{ij}=e^{-D_{ij}}
We’ll also be interested in the scaled version for some
t \in (0,\infty)
, wheretZ
is the matrix for metric spacetX
andtZ_{ij}=e^{-tD_{ij}}
The magnitude, in particular of
|tX|
is|tX| = sum_{i,j} ((tZ)^{-1})_{ij}
where(tZ)^{-1}
is the inverse of the matrixtZ
, assuming it exists.The magnitude function is
M: t -> |tX|
- Parameters:
D (2-D array) – 2-D square distance matrix
t_range (length 2 list)
- Returns:
T is the list of
t
values,M
is the list of associated values|tX|
.- Return type:
T,M [1-D arrays]