pyriemann.utils.covariance.covariances¶
- pyriemann.utils.covariance.covariances(X, estimator='cov', **kwds)¶
Estimation of covariance matrix.
- Parameters
- Xndarray, shape (n_matrices, n_channels, n_times)
Multi-channel time-series.
- estimator{‘corr’, ‘cov’, ‘hub’, ‘lwf’, ‘mcd’, ‘oas’, ‘sch’, ‘scm’, ‘stu’, ‘tyl’}, default=’scm’
Covariance matrix estimator [est]:
‘corr’ for correlation coefficient matrix [corr] supporting complex inputs,
‘cov’ for numpy based covariance matrix [cov] supporting complex inputs,
‘hub’ for Huber’s M-estimator based covariance matrix [mest] supporting complex inputs,
‘lwf’ for Ledoit-Wolf shrunk covariance matrix [lwf],
‘mcd’ for minimum covariance determinant matrix [mcd],
‘oas’ for oracle approximating shrunk covariance matrix [oas],
‘sch’ for Schaefer-Strimmer shrunk covariance matrix [sch],
‘scm’ for sample covariance matrix [scm],
‘stu’ for Student-t’s M-estimator based covariance matrix [mest] supporting complex inputs,
‘tyl’ for Tyler’s M-estimator based covariance matrix [mest] supporting complex inputs,
or a callable function.
For regularization, consider ‘lwf’ or ‘oas’. For robustness, consider ‘hub’, ‘mcd’, ‘stu’ or ‘tyl’.
- **kwdsoptional keyword parameters
Any further parameters are passed directly to the covariance estimator.
- Returns
- covmatsndarray, shape (n_matrices, n_channels, n_channels)
Covariance matrices.
References
- est
- corr
https://numpy.org/doc/stable/reference/generated/numpy.corrcoef.html
- cov
https://numpy.org/doc/stable/reference/generated/numpy.cov.html
- lwf
https://scikit-learn.org/stable/modules/generated/sklearn.covariance.ledoit_wolf.html
- mcd
https://scikit-learn.org/stable/modules/generated/sklearn.covariance.MinCovDet.html
- mest(1,2,3)
- oas
https://scikit-learn.org/stable/modules/generated/sklearn.covariance.OAS.html
- sch
- scm
https://scikit-learn.org/stable/modules/generated/sklearn.covariance.empirical_covariance.html