mahalanofix               package:fpc               R Documentation

_M_a_h_a_l_a_n_o_b_i_s _d_i_s_t_a_n_c_e_s _f_r_o_m _c_e_n_t_e_r _o_f _i_n_d_e_x_e_d _p_o_i_n_t_s

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

     Computes the vector of (classical or robust) Mahalanobis distances
     of all points of 'x' to the center of the points indexed (or
     weighted) by 'gv'. The latter also determine the covariance
     matrix.

     Thought for use within 'fixmahal'.

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

     mahalanofix(x, n = nrow(as.matrix(x)), p = ncol(as.matrix(x)), gv =
     rep(1, times = n), cmax = 1e+10, method = "ml")

     mahalanofuz(x, n = nrow(as.matrix(x)), p = ncol(as.matrix(x)),
                              gv = rep(1, times=n), cmax = 1e+10) 

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

       x: a numerical data matrix, rows are points, columns are
          variables.

       n: positive integer. Number of points.

       p: positive integer. Number of variables.

      gv: for 'mahalanofix' a logical or 0-1 vector of length 'n'. For
          'mahalanofuz' a numerical vector with values between 0 and 1.

    cmax: positive number. used in 'solvecov' if covariance matrix is
          singular.

  method: '"ml"', '"classical"', '"mcd"' or '"mve"'. Method to compute
          the covariance matrix estimator. See 'cov.rob', 'fixmahal'.

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

     'solvecov' is used to invert the covariance matrix. The methods
     '"mcd"' and '"mve"' in 'mahalanofix' do not work properly with
     point constellations with singular covariance matrices!

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

     A list of the following components: 

      md: vector of Mahalanobis distances.

      mg: mean of the points indexed by 'gv', weighted mean in
          'mahalanofuz'.

    covg: covariance matrix of the points indexed by 'gv', weighted
          covariance matrix in 'mahalanofuz'.

  covinv: 'covg' inverted by 'solvecov'.

    coll: logical. If 'TRUE', 'covg' has been (numerically) singular.

_N_o_t_e:

     Methods '"mcd"' and '"mve"' require library 'lqs'.

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

     Christian Hennig chrish@stats.ucl.ac.uk <URL:
     http://www.homepages.ucl.ac.uk/~ucakche/>

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

     'fixmahal', 'solvecov', 'cov.rob'

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

       x <- c(1,2,3,4,5,6,7,8,9,10)
       y <- c(1,2,3,8,7,6,5,8,9,10)
       mahalanofix(cbind(x,y),gv=c(0,0,0,1,1,1,1,1,0,0))
       mahalanofix(cbind(x,y),gv=c(0,0,0,1,1,1,1,0,0,0))
       mahalanofix(cbind(x,y),gv=c(0,0,0,1,1,1,1,1,0,0),method="mcd")
       mahalanofuz(cbind(x,y),gv=c(0,0,0.5,0.5,1,1,1,0.5,0.5,0))

