Robust Covariance/Correlation Matrix Estimation

DESCRIPTION:

Computes robust estimates of multivariate location and scatter.

USAGE:

covRob(data, corr = F, center = T, distance = T, na.action = na.fail, estim
= "auto", control = covRob.control(estim, ...), ...)

REQUIRED ARGUMENTS:

data
a matrix or data frame. Columns represent variables, and rows represent observations.

OPTIONAL ARGUMENTS:

corr
logical flag; if corr=T the estimated correlation matrix is returned.
center
logical flag or numeric vector containing the location about which the covariance is to be taken. If center=T then a robust estimate of the center is computed; if center=F then no centering takes place and the center is set equal to zero. The center argument is only used by the Stahel-Donoho estimator (which is not the default estimator).
distance
logical flag; if distance=T the Mahalanobis distances are computed.
na.action
a function to filter missing data. The default (with na.fail) is to create an error if any missing values are found. A possible alternative is na.omit, which deletes observations that contain one or more missing values.
estim
the robust estimator used by covRob. The choices are: "mcd" for the Fast MCD algorithm of Rousseeuw and Van Driessen, "donostah" for the Donoho-Stahel projection based estimator, "M" for the constrained M estimator provided by Rocke, "pairwiseQC" for the quadrant correlation based pairwise estimator, and "pairwiseGK" for the Gnanadesikan-Kettenring pairwise estimator. The default "auto" selects from "donostah", "mcd", and "pairwiseQC" with the goal of producing a good estimate in a resonable amount of time.
control
a list of control parameters to be used in the numerical algorithms. See for the possible control parameters and their default settings.
...
control parameters in may be passed directly to covRob.

VALUE:

an object of class "covRob" with components:
cov
the robust estimate of the covariance/correlation matrix.
center
a robust estimate (or the specification) of the location vector.
dist
the Mahalanobis distances computed with a robust estimate of covariance, only returned if distance=T.
iter
the number of iterations used.
evals
eigenvalues of the covariance matrix if corr=F ; otherwise eigenvalues of the correlation matrix.

NOTE:

Almost all of the estimation methods require that the number of rows of data be more than twice the number of columns. The pairwise estimation methods don't strictly require this, but they often fail on short datasets. You may want to use something like if(is( cov <- try(covRob(x)), "Error")) cov <- list(cov=var(x)) to get a robust estimate of covariance if it works and fall back to a classical estimate otherwise.

REFERENCES:

Marazzi, A. (1993). Algorithms, routines, and S functions for robust statistics. Wadsworth & Brooks/Cole, Pacific Grove, CA.

Rousseeuw, P.J. and Van Driessen, K. (1999). A Fast Algorithm for the Minimum Covariance Determinant Estimator, Technometrics, 41, 212-223.

SEE ALSO:

, .

EXAMPLES:

covRob(stack.dat) 
covRob(stack.dat, estim = "mcd", quan = .75, ntrial = 1000)