procrustes.generalized

Generalized Procrustes Module.

procrustes.generalized.generalized(array_list: List[ndarray], ref: ndarray | None = None, tol: float = 1e-07, n_iter: int = 200, check_finite: bool = True) Tuple[List[ndarray], float][source]

Generalized Procrustes Analysis.

Parameters:
  • array_list (List) -- The list of 2D-array which is going to be transformed.

  • ref (ndarray, optional) -- The reference array to initialize the first iteration. If None, the first array in array_list will be used.

  • tol (float, optional) -- Tolerance value to stop the iterations.

  • n_iter (int, optional) -- Number of total iterations.

  • check_finite (bool, optional) -- If true, convert the input to an array, checking for NaNs or Infs.

Returns:

  • array_aligned (List) -- A list of transformed arrays with generalized Procrustes analysis.

  • new_distance_gpa (float) -- The distance for matching all the transformed arrays with generalized Procrustes analysis.

Notes

Given a set of matrices, \(\mathbf{A}_1, \mathbf{A}_2, \cdots, \mathbf{A}_k\) with \(k > 2\), the objective is to minimize in order to superimpose pairs of matrices.

\[\min \quad = \sum_{i<j}^{j} {\left\| \mathbf{A}_i \mathbf{T}_i - \mathbf{A}_j \mathbf{T}_j \right\| }^2\]

This function implements the Equation (20) and the corresponding algorithm in Gower's paper.