CovMcd(x,
raw.only=FALSE, alpha=control@alpha, nsamp=control@nsamp,
scalefn=control@scalefn, maxcsteps=control@maxcsteps,
initHsets=NULL, save.hsets=FALSE,
seed=control@seed, trace=control@trace,
use.correction=control@use.correction,
control=CovControlMcd(), ...)
alpha*n
observations are used for computing the determinant. Allowed values
are between 0.5 and 1 and the default is 0.5."best"
,
"exact"
or "deterministic"
. Default is nsamp = 500
.
For nsamp="best"
exhaustive enumeration is done, as long as the
nufunction
to compute a robust scale
estimate or character string specifying a rule determining such a
function, see rrcov.control
.1:n
).initHsets
.seed = NULL
trace = FALSE
use.correction=TRUE
CovControlMcd-class
containing estimation options - same as these provided in the function
specification. If the control object is supplied, the parametecovMcd
.CovMcd-class
which is a subclass of the
virtual class CovRobust-class
.CovMcd-class
containing the estimates.
The implementation of the function is similar to the existing Rfunction
covMcd()
which returns an S3 object.
The MCD method looks for the $h (> n/2)$
observations (out of $n$) whose classical
covariance matrix has the lowest possible determinant. The raw MCD
estimate of location is then the average of these $h$ points,
whereas the raw MCD estimate of scatter is their covariance matrix,
multiplied by a consistency factor and a finite sample correction factor
(to make it consistent at the normal model and unbiased at small samples).
Both rescaling factors are returned also in the vector raw.cnp2
of length 2. Based on these raw MCD estimates, a reweighting step is performed
which increases the finite-sample efficiency considerably - see Pison et al. (2002).
The rescaling factors for the reweighted estimates are returned in the
vector cnp2
of length 2. Details for the computation of the finite
sample correction factors can be found in Pison et al. (2002).
The finite sample corrections can be suppressed by setting use.correction=FALSE
.
The implementation in rrcov uses the Fast MCD algorithm of Rousseeuw and Van Driessen (1999)
to approximate the minimum covariance determinant estimator.cov.mcd
from package data(hbk)
hbk.x <- data.matrix(hbk[, 1:3])
CovMcd(hbk.x)
cD <- CovMcd(hbk.x, nsamp = "deterministic")
summary(cD)
## the following three statements are equivalent
c1 <- CovMcd(hbk.x, alpha = 0.75)
c2 <- CovMcd(hbk.x, control = CovControlMcd(alpha = 0.75))
## direct specification overrides control one:
c3 <- CovMcd(hbk.x, alpha = 0.75,
control = CovControlMcd(alpha=0.95))
c1
Run the code above in your browser using DataLab