I am searching some documents and examples related multivariate outlier detection with robust (minimum covariance estimation) mahalanobis distance. I have 6 variables and want to plot them to show outliers also. Do you have any sources?
Here are the codes, but I think something going wrong. Because I have over 2 million cases it has taken only n=500.
> CovMcd(new)
Call:
CovMcd(x = new)
-> Method: Fast MCD(alpha=0.5 ==> h=1342195); nsamp = 500; (n,k)mini = (300,5)
Robust Estimate of Location:
logdgr logtr lph lpm lpr
4.391 2.956 -2.722 -4.802 -4.802
Robust Estimate of Covariance:
logdgr logtr lph lpm lpr
logdeger 1.0183 0.8981 0.6427 0.7112 0.7113
loghacim 0.8981 1.0173 0.9613 0.9539 0.9541
lph 0.6427 0.9613 1.6921 1.3770 1.3772
lpd 0.7112 0.9539 1.3770 1.3085 1.3087
lpr 0.7113 0.9541 1.3772 1.3087 1.3089
> summary(mcd)
Call:
CovMcd(x = data)
Robust Estimate of Location:
[1] 3.5 2.0
Robust Estimate of Covariance:
[,1] [,2]
[1,] 3.5 0.8
[2,] 0.8 0.8
Eigenvalues of covariance matrix:
[1] 3.7192 0.5808
Robust Distances:
[1] 2.0833 0.8333 2.0833 2.0833 0.8333 2.0833
> mest <- CovMest(new)
> show(mcd)
Call:
CovMcd(x = data)
-> Method: Fast MCD(alpha=0.5 ==> h=4); nsamp = 500; (n,k)mini = (300,5)
Robust Estimate of Location:
[1] 3.5 2.0
Robust Estimate of Covariance:
[,1] [,2]
[1,] 3.5 0.8
[2,] 0.8 0.8
covMcd
inrobustbase
both produce a vector of robust Mahalanobis distances (usually called statistical distances) wrt to the FMCD estimates of covariance and location. Try ?covMcd
and look formah
as well as ?covPlot
. The outliers are the observations for whichmcd.wt
is 0. $\endgroup$ – user603 Feb 12 '15 at 10:29Error: could not find function "CovMcd"
) $\endgroup$ – user603 Feb 12 '15 at 19:00