good part of the data. cov.mve and
cov.mcd are compatibility wrappers.cov.rob(x, cor = FALSE, quantile.used = floor((n + p + 1)/2),
method = c("mve", "mcd", "classical"),
nsamp = "best", seed)cov.mve(…)
cov.mcd(…)
good points.
cov.mve or cov.mcd forces mve or mcd
respectively.
"best" or "exact" or
"sample".
If "sample" the number chosen is min(5*p, 3000), taken
from Rousseeuw and Hubert (1997). If "best" exhaustive
enumeration is done up to 5000 samples: if "exact"
exhaustive enumeration will be attempted however many samples are needed.
RNGkind. The
current value of .Random.seed will be preserved if it is set.
cov.rob other than method.cor = TRUE) the estimate of the correlation
matrix.
quantile.used.
"mve", an approximate search is made of a subset of
size quantile.used with an enclosing ellipsoid of smallest volume; in
method "mcd" it is the volume of the Gaussian confidence
ellipsoid, equivalently the determinant of the classical covariance
matrix, that is minimized. The mean of the subset provides a first
estimate of the location, and the rescaled covariance matrix a first
estimate of scatter. The Mahalanobis distances of all the points from
the location estimate for this covariance matrix are calculated, and
those points within the 97.5% point under Gaussian assumptions are
declared to be good. The final estimates are the mean and rescaled
covariance of the good points. The rescaling is by the appropriate percentile under Gaussian data; in
addition the first covariance matrix has an ad hoc finite-sample
correction given by Marazzi. For method "mve" the search is made over ellipsoids determined
by the covariance matrix of p of the data points. For method
"mcd" an additional improvement step suggested by Rousseeuw and
van Driessen (1999) is used, in which once a subset of size
quantile.used is selected, an ellipsoid based on its covariance
is tested (as this will have no larger a determinant, and may be smaller).lqsset.seed(123)
cov.rob(stackloss)
cov.rob(stack.x, method = "mcd", nsamp = "exact")
Run the code above in your browser using DataLab