Minimum covariance determinant by C-steps from random starts, then Mahalanobis distances against the robust location and scatter, compared with a chi-squared cutoff.
Arguments
- X
numeric matrix, one row per observation.
- support_fraction
fraction of points in the support h, in (0.5, 1]. Default 0.75.
- n_trials
number of random starts.
- alpha
tail probability for the chi-squared cutoff.
- seed
integer seed. R's generator is not numpy's, so the subsets differ; the fitted location and scatter agree to within sampling noise, and the outlier flags agree.
Details
This exists because of MASKING. The classical covariance is inflated
by the very outliers one is hunting, so their classical Mahalanobis
distances come out small and they hide themselves. Fitting the
covariance on a clean majority subset removes that feedback loop –
the returned classical_distance is there to make the
difference visible.
