pyriemann.utils.mean.mean_logchol

pyriemann.utils.mean.mean_logchol(X, sample_weight=None)

Mean of SPD/HPD matrices according to the log-Cholesky metric.

Log-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{lower}(\text{chol}(\mathbf{X}_i)) + \exp \left( \sum_i w_i \log(\text{diag}(\text{chol}(\mathbf{X}_i))) \right)\]
Parameters:
Xndarray, shape (n_matrices, n, n)

Set of SPD/HPD matrices.

sample_weightNone | ndarray, shape (n_matrices,), default=None

Weights for each matrix. If None, it uses equal weights.

Returns:
Mndarray, shape (n, n)

Log-Cholesky mean.

See also

mean_covariance

Notes

Added in version 0.7.

References

[1]

Riemannian geometry of symmetric positive definite matrices via Cholesky decomposition Z. Lin. SIAM J Matrix Anal Appl, 2019, 40(4), pp. 1353-1370.