2.3.6. Magnitude

This module is related to calculation of the magnitude. Some relevant links and references are below.

2.3.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 space X, 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 points x_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 entries Z_{ij}=e^{-D_{ij}}

  • We’ll also be interested in the scaled version for some t \in (0,\infty), where tZ is the matrix for metric space tX and tZ_{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 matrix tZ, 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]