covMcd              package:robustbase              R Documentation

_R_o_b_u_s_t _L_o_c_a_t_i_o_n _a_n_d _S_c_a_t_t_e_r _E_s_t_i_m_a_t_i_o_n _v_i_a _M_C_D

_D_e_s_c_r_i_p_t_i_o_n:

     Compute a robust multivariate location and scale estimate with a
     high breakdown point, using the 'Fast MCD' (Minimum Covariance
     Determinant) estimator.

_U_s_a_g_e:

     covMcd(x, cor = FALSE, alpha = 1/2, nsamp = 500, seed = NULL,
            trace = FALSE, use.correction = TRUE, control)

_A_r_g_u_m_e_n_t_s:

       x: a matrix or data frame. 

     cor: should the returned result include a correlation matrix?
          Default is 'cor = FALSE'

   alpha: numeric parameter controlling 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'.  For 'nsamp = "best"'
          exhaustive enumeration is done, as long as the number of
          trials does not exceed 5000. For '"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: initial seed for random generator, see 'rrcov.control'.

   trace: logical indicating if intermediate results should be printed;
          defaults to 'FALSE'.

use.correction: whether to use finite sample correction factors;
          defaults to 'TRUE'.

 control: a list with estimation options - this includes those above
          provided in the function specification.  If 'control' 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.

_D_e_t_a_i_l_s:

     The minimum covariance determinant estimator of location and
     scatter implemented in 'covMcd()' is similar to R function
     'cov.mcd()' in 'MASS'.  The MCD method looks for the h (> n/2) (h
     = h(alpha,n,p) = 'h.alpha.n(alpha,n,p)') 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).

     The implementation of 'covMcd' uses the Fast MCD algorithm of
     Rousseeuw and Van Driessen (1999) to approximate the minimum
     covariance determinant estimator.

     Both rescaling factors (consistency and finite sample) 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'.

_V_a_l_u_e:

     An object of class '"mcd"' which is basically 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, with 'length(best) == quan =
          h.alpha.n(alpha,n,p)'.

     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 numeric matrix, without 'NA's.

   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, h, 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).

    call: the call used (see 'match.call').

_A_u_t_h_o_r(_s):

     Valentin Todorov valentin.todorov@chello.at, based on work written
     for S-plus by Peter Rousseeuw and Katrien van Driessen from
     University of Antwerp.

_R_e_f_e_r_e_n_c_e_s:

     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.

_S_e_e _A_l_s_o:

     'cov.mcd' from package 'MASS'; 'covOGK' as cheaper alternative for
     larger dimensions.

_E_x_a_m_p_l_e_s:

     data(hbk)
     hbk.x <- data.matrix(hbk[, 1:3])
     covMcd(hbk.x)

     ## the following three statements are equivalent
     c1 <- covMcd(hbk.x, alpha = 0.75)
     c2 <- covMcd(hbk.x, control = rrcov.control(alpha = 0.75))
     ## direct specification overrides control one:
     c3 <- covMcd(hbk.x, alpha = 0.75,
                  control = rrcov.control(alpha=0.95))
     c1

