Minimum Covariance Determinant (MCD) is a robust estimator of
covariance introduced by Rousseeuw [1]. The main idea behind the MCD
is to find a fixed proportion of observations whose scatter matrix has
the minimum determinant.
The MCD estimator is computed with the FastMCD algorithm [2].
[1] P. J. Rousseeuw. Least median of squares regression. J. Am Stat
Ass, 79:871, 1984.
[2] P. J. Rousseeuw and K. Van Driessen. A fast algorithm for the
minimum covariance determinant estimator. Technometrics, 41(3):212,
1999.
I had to consider the case of assumed centered data separately,
yielding a lot of "if... else..." instructions and a lot
"assume_centered" arguments wherever needed.
Note that makes the code less readable (check lw_vs_oas.py example).
I still use a function for computing the empirical covariance matrix
since it is useful for dealing with 1-dimensional covariances (that
have to be reshaped). Plus, it corresponds to the scheme used for the
LedoitWolf, ShrunkCovariance and OAS classes (an object + an external
function computing the covariance estimate).
It had to be possible to fit a simple Maximum Likelihood Estimator of
covariance without having to instantiate a new Covariance object, as
is can result in a loss in code clarity and in performances. The
separation of algorithm and object follows the model used in
shrun_covariance_.py classes.
We now have the inheritance scheme:
Covariance <-- ShrunkCovariance <-- LedoitWolf and
Covariance <-- ShrunkCovariance <-- OAS
since LedoitWolf ans OAS are particular cases of shrinkage.
A nex example has been added. Previous one has been updated.