spd_learn.functional.mean_chol#
- spd_learn.functional.mean_chol(X, sample_weight=None, **kwargs)[source]#
Mean of SPD/HPD matrices according to the Cholesky metric.
Cholesky mean \(\mathbf{M}\) is \(\mathbf{M} = \mathbf{L} \mathbf{L}^H\), where \(\mathbf{L}\) is computed as [1]:
\[\mathbf{L} = \sum_i w_i \text{chol}(\mathbf{X}_i)\]with \(w\) being the weights which sum to 1.
- Parameters:
X (ndarray, shape (..., n_matrices, n, n)) – Set of SPD/HPD matrices.
sample_weight (None | ndarray, shape (n_matrices,), default=None) – Weights for each matrix. If None, it uses equal weights.
- Returns:
M – Cholesky mean.
- Return type:
ndarray, shape (…, n, n)
Notes
Added in version 0.10.
Changed in version 0.12: Add support for NumPy and PyTorch.
See also
References
[1]Non-Euclidean statistics for covariance matrices, with applications to diffusion tensor imaging I.L. Dryden, A. Koloydenko, D. Zhou. Ann Appl Stat, 2009, 3(3), pp. 1102-1123.