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:
hint

Number of observations in evaluation set for minimizing determinant.

h_startint

Number of observations used in starting mean and covariance.

mean_func, scale_funccallable or None

Mean and scale function for initial standardization. Current defaults, if they are None, are median and mad, but default scale_func will likely change.

maxiterint

Maximum number of iterations for the c-step of the best candidate solution.

options_startNone or dict

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_raw attribute.

trim_fracfloat in (0, 1)

Trim fraction used if reweight is true. Used to compute quantile of chisquare distribution with tail probability 1 - trim_frac.

maxiter_stepint

Number of iteration in the c-step. In the current implementation a small maxiter in the c-step does not find the optimal solution.

Returns:
CovDetMCDResult

Named tuple with mean, cov, method and extra attributes depending on reweight. See CovDetMCDResult for details.