pyriemann.utils.covariance.block_covariances

pyriemann.utils.covariance.block_covariances(X, blocks, estimator='cov', **kwds)

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_matrices, n_channels, n_times)

Multi-channel time-series.

blocks: list of int

List of block sizes.

estimatorstring, default=”cov”

Covariance matrix estimator, see pyriemann.utils.covariance.covariances().

**kwdsoptional keyword parameters

Any further parameters are passed directly to the covariance estimator.

Returns:
covmatsndarray, shape (n_matrices, n_channels, n_channels)

Block diagonal covariance matrices.