calculateDistance: Internal: Matrix difference

View source: R/helper_test_MGD.R

calculateDistanceR Documentation

Internal: Matrix difference

Description

Calculates the average of the differences between all possible pairs of (symmetric) matrices in a list using a given distance measure.

Usage

calculateDistance(
  .matrices = NULL, 
  .distance = args_default()$.distance
  )

Arguments

.matrices

A list of at least two matrices.

.distance

Character string. A distance measure. One of: "geodesic" or "squared_euclidean". Defaults to "geodesic".

Details

.matrices must be a list of at least two matrices. If more than two matrices are supplied the arithmetic mean of the differences between all possible pairs of (symmetric) matrices in a list is computed. Mathematically this is n chose 2. Hence, supplying a large number of matrices will become computationally challenging.

Currently two distance measures are supported:

geodesic

(Default) The geodesic distance.

squared_euclidean

The squared Euclidean distance

Value

A numeric vector of length one containing the (arithmetic) mean of the differences between all possible pairs of matrices supplied via .matrices.


M-E-Steiner/cSEM documentation built on March 18, 2024, 12:18 p.m.