Spatial symmetrized signs, ranks and signed rankspackage:SpatialNPR Documentation

_S_p_a_t_i_a_l _s_y_m_m_e_t_r_i_z_e_d _s_i_g_n_s, _r_a_n_k_s _a_n_d _s_i_g_n_e_d _r_a_n_k_s

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

     Functions to compute spatial symmetrized signs, ranks and signed
     ranks.

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

     spatial.symmsign(X, shape = TRUE, na.action = na.fail, ...)
     spatial.rank(X, shape = TRUE, na.action = na.fail, ...)
     spatial.signrank(X, center = TRUE, shape = TRUE, na.action = na.fail, ...)

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

       X: a matrix or a data frame

  center: a vector or a logical, see details

   shape: a matrix or a logical, see details

na.action: a function which indicates what should happen when the data
          contain 'NA's.  Default is to fail.

     ...: arguments that can be passed on to function used for the
          estimation of shape.

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

     The spatial signs of an observed vector is simply the vector,
     possibly affinely transformed first, multiplied by its Euclidian
     length. See 'spatial.sign' for a precise definition. Symmetrized
     spatial signs are the spatial signs of the pairwise differences of
     the data 

                      ||x_i-x_j||^{-1}(x_i-x_j)

     (there are 'n' over 2 of these). Spatial rank of an observation is
     the average of the signs of the differences of that observation
     and the others:

               R(x_i)=ave_j{||x_i-x_j||^{-1}(x_i-x_j)}

     Spatial signed rank of an observation is defined as

          Q(x_i)=(R(x_i)+ave_j{||x_i+x_j||^{-1}(x_i+x_j)})/2


     If a numerical value is given for 'shape' and/or 'center' these
     are used to transform the data before the computation of signs or
     ranks. A logical TRUE indicates that the shape or center should be
     estimated. In this case an affine transformation that makes the
     resulting signs or ranks have a covariance matrix equal or
     proportional to the identity matrix and centerd on the origin is
     found. A logical FALSE indicates that the null value, that is, the
     identity matrix or the origin, should be used. Note that only
     signed ranks depend on a center.

     The value of shape and/or location used are returned as
     attributes.

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

     Seija Sirkia, ssirkia@maths.jyu.fi

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

     'spatial.sign' for the signs, spatial sign and rank matrices and
     'ae.hl.estimate' for the standardizing transformations

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

     A<-matrix(c(1,2,-3,4),ncol=2)
     X<-matrix(rt(20,1),ncol=2)%*%t(A)
     def.par<-par(no.readonly=TRUE) # for resetting
     layout(matrix(1:4,ncol=2,nrow=2,byrow=TRUE))
     plot(X,col=c(2,rep(1,19)))
     plot(spatial.symmsign(X),col=c(2,rep(1,19)),xlim=c(-1,1),ylim=c(-1,1))
     theta<-seq(0,2*pi,length=1000)
     lines(sin(theta),cos(theta))
     plot(spatial.rank(X),col=c(2,rep(1,19)),xlim=c(-1,1),ylim=c(-1,1))
     lines(sin(theta),cos(theta))
     plot(spatial.signrank(X),col=c(2,rep(1,19)),xlim=c(-1,1),ylim=c(-1,1))
     lines(sin(theta),cos(theta))
     par(def.par)

