pyriemann.geometry.covariance.block_covariances¶
- pyriemann.geometry.covariance.block_covariances(X, blocks, estimator='cov', **kwds)[source]¶
Compute block diagonal covariance.
Calculates block diagonal matrices where each block is a covariance matrix of a subset of channels. Block sizes are passed as a list of integers and can vary. The sum of block sizes must equal the number of channels in X.
- Parameters:
- Xndarray, shape (…, n_channels, n_times)
Multi-channel time-series.
- blocks: list of int
List of block sizes.
- estimatorstring | callable, default=”cov”
Covariance matrix estimator, see
pyriemann.geometry.covariance.covariances().- **kwdsoptional keyword parameters
Any further parameters are passed directly to the covariance estimator.
- Returns:
- covmatsndarray, shape (…, n_channels, n_channels)
Block diagonal covariance matrices.
Notes
Changed in version 0.12: Add support for NumPy and PyTorch.