statsmodels.robust.covariance.CovDetMCD.fit#
- CovDetMCD.fit(h, *, h_start=None, mean_func=None, scale_func=None, maxiter=100, options_start=None, reweight=True, trim_frac=0.975, maxiter_step=100)[source]#
Compute minimum covariance determinant estimate of mean and covariance
- Parameters:
- h
int Number of observations in evaluation set for minimizing determinant.
- h_start
int Number of observations used in starting mean and covariance.
- mean_func, scale_func
callableorNone Mean and scale function for initial standardization. Current defaults, if they are None, are median and mad, but default scale_func will likely change.
- maxiter
int Maximum number of iterations for the c-step of the best candidate solution.
- options_start
Noneordict Options for the starting estimators. Currently not used. TODO: which options? e.g., for OGK
- reweightbool
If reweight is true, then a reweighted estimator is returned. The reweighting is based on a chisquare trimming of Mahalanobis distances. The raw results are in the
results_rawattribute.- trim_frac
floatin(0, 1) Trim fraction used if reweight is true. Used to compute quantile of chisquare distribution with tail probability 1 - trim_frac.
- maxiter_step
int Number of iteration in the c-step. In the current implementation a small maxiter in the c-step does not find the optimal solution.
- h
- Returns:
CovDetMCDResultNamed tuple with mean, cov, method and extra attributes depending on reweight. See
CovDetMCDResultfor details.