Compute Riemannian Distance Between SPD Matrices (Log-Euclidean Metric)
Source:R/riemannian_geometry.R
riemannian_distance_spd.Rd
Calculates the Riemannian distance between two symmetric positive-definite (SPD) matrices S1 and S2, using the Log-Euclidean metric as described by Mitteroecker & Bookstein (2008) and Arsigny et al. (2006). `d(S1, S2) = ||logm(S1) - logm(S2)||_F` which, for the M&B formulation, is effectively `sqrt(sum(log(lambda_j(S2^-1 S1))^2))`. This function is a core component of RGEOM-001.
Arguments
- S1
A numeric, symmetric matrix (p x p).
- S2
A numeric, symmetric matrix (p x p).
- regularize_epsilon
A small positive value used for regularization to ensure matrices are SPD before inversion and eigenvalue computation. Default 1e-6.
- eigenvalue_floor
A small positive value to threshold relative eigenvalues before taking the logarithm, preventing issues with `log(0)`. Default 1e-9.