covMcd {rrcov} | R Documentation |
Compute a multivariate location and scale estimate with a high breakdown point using the Fast MCD (Minimum Covariance Determinant) Estimator.
covMcd(x, cor=FALSE, alpha=1/2, nsamp=500, seed=0, print.it=FALSE, use.correction=TRUE, control)
x |
a matrix or data frame. |
cor |
should the returned result include a correlation matrix? Default is cor = FALSE |
alpha |
This parameter controls the size of the subsets over which the
determinant is minimized, i.e. alpha*n observations are used
for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.
|
nsamp |
number of subsets used for initial estimates or "best"
or "exact" . Default is nsamp = 500 .
If nsamp="best" exhaustive enumeration is done, as far as the number of trials do not exceed 5000.
If nsamp="exact" exhaustive enumeration will be attempted however many samples are needed.
In this case a warning message will be displayed saying that the computation can take a very long time. |
seed |
starting value for random generator. Default is seed = 0 |
print.it |
whether to print intermediate results. Default is print.it = FALSE |
use.correction |
whether to use finite sample correction factors. Default is use.correction=TRUE |
control |
a list with estimation options - same as these provided in the fucntion specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object. |
This function computes the minimum covariance determinant estimator of location and
scatter. 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 with a
consistency factor and a finite sample correction factor. 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 eficiency 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.
A list with components
center |
the final estimate of location. |
cov |
the final estimate of scatter. |
cor |
the (final) estimate of the correlation matrix (only if cor = TRUE ) .
|
crit |
the value of the criterion, i.e. the determinant. |
best |
the best subset found and used for computing the raw estimates. The size of best is equal to quan .
|
mah |
mahalanobis distances of the observations using the final estimate of the location and scatter. |
mcd.wt |
weights of the observations using the final estimate of the location and scatter. |
cnp2 |
a vector of length two containing the consistency correction factor and the finite sample correction factor of the final estimate of the covariance matrix. |
raw.center |
the raw (not reweighted) estimate of location. |
raw.cov |
the raw (not reweighted) estimate of scatter. |
raw.mah |
mahalanobis distances of the observations based on the raw estimate of the location and scatter. |
raw.weights |
weights of the observations based on the raw estimate of the location and scatter. |
raw.cnp2 |
a vector of length two containing the consistency correction factor and the finite sample correction factor of the raw estimate of the covariance matrix. |
X |
the input data as a matrix. |
n.obs |
total number of observations. |
alpha |
the size of the subsets over which the determinant is minimized (the default is (n+p+1)/2). |
quan |
the number of observations on which the MCD is based.
If quan equals n.obs , the MCD is the classical covariance matrix.
|
method |
character string naming the method (Minimum Covariance Determinant). |
P. J. Rousseeuw and A. M. Leroy (1987) Robust Regression and Outlier Detection. Wiley.
P. J. Rousseeuw and K. van Driessen (1999) A fast algorithm for the minimum covariance determinant estimator. Technometrics 41, 212–223.
Pison, G., Van Aelst, S., and Willems, G. (2002), Small Sample Corrections for LTS and MCD, Metrika, 55, 111-123.
data(hbk) covMcd(hbk.x) # the following three statements are equivalent covMcd(hbk.x, alpha=0.75) covMcd(hbk.x, control = rrcov.control(alpha=0.75)) covMcd(hbk.x, alpha = 0.75, control = rrcov.control(alpha=0.95))