pyriemann.utils.mean.mean_harmonic¶
- pyriemann.utils.mean.mean_harmonic(covmats, sample_weight=None)¶
Harmonic mean of SPD matrices.
\[\mathbf{C} = \left(\frac{1}{m} \sum_i {\mathbf{C}_i}^{-1}\right)^{-1}\]- Parameters
- covmatsndarray, shape (n_matrices, n_channels, n_channels)
Set of SPD matrices.
- sample_weightNone | ndarray, shape (n_matrices,), default=None
Weights for each matrix. If None, it uses equal weights.
- Returns
- Cndarray, shape (n_channels, n_channels)
Harmonic mean.