许多统计学问题需要做总体协方差矩阵评估,可以看作是数据集散点图的评估。
大多数情况下,这样一个评估会在与一个对估计质量有很大影响(大小、结构、同质性)的样本上完成。
sklearn.covariance包为在各种条件下精确评估总体协方差矩阵提供了有效工具。
我们假设观察值是独立且同分布的。
模块提供了以下四种常见估计方法:
class sklearn.covariance.EmpiricalCovariance(store_precision=True, assume_centered=False)
covariance.EmpiricalCovariance ([…]) |
Maximum likelihood covariance estimator |
---|---|
covariance.EllipticEnvelope ([…]) |
An object for detecting outliers in a Gaussian distributed dataset. |
covariance.GraphicalLasso ([alpha, mode, …]) |
Sparse inverse covariance estimation with an l1-penalized estimator. |
covariance.GraphicalLassoCV ([alphas, …]) |
Sparse inverse covariance w/ cross-validated choice of the l1 penalty. |
covariance.LedoitWolf ([store_precision, …]) |
LedoitWolf Estimator |
covariance.MinCovDet ([store_precision, …]) |
Minimum Covariance Determinant (MCD): robust estimator of covariance. |
covariance.OAS ([store_precision, …]) |
Oracle Approximating Shrinkage Estimator |
covariance.ShrunkCovariance ([…]) |
Covariance estimator with shrinkage |
covariance.empirical_covariance (X[, …]) |
Computes the Maximum likelihood covariance estimator |
---|---|
covariance.graphical_lasso (emp_cov, alpha[, …]) |
l1-penalized covariance estimator |
covariance.ledoit_wolf (X[, assume_centered, …]) |
Estimates the shrunk Ledoit-Wolf covariance matrix. |
covariance.oas (X[, assume_centered]) |
Estimate covariance with the Oracle Approximating Shrinkage algorithm. |
covariance.shrunk_covariance (emp_cov[, …]) |
Calculates a covariance matrix shrunk on the diagonal |