Shape matrices {SpatialNP} | R Documentation |
Iterative algorithms to find shape matrices based on spatial signs and ranks and the k-step versions of these.
rank.shape(X, init = NULL, steps = Inf, eps = 1e-06, maxiter = 100, na.action = na.fail) signrank.shape(X, location = NULL, init = NULL, steps = Inf, eps = 1e-06, maxiter = 100, na.action = na.fail) spatial.shape(X, score = c("sign", "symmsign", "rank", "signrank"), location = NULL, init = NULL, steps = Inf, eps = 1e-06, maxiter = 100, na.action = na.fail)
X |
a matrix or a data frame |
score |
a character string indicating which transformation of the observations should be used |
location |
an optional vector giving the location of the data |
init |
an optional starting value for the iteration |
steps |
fixed number of iteration steps to take, if Inf iteration is repeated until convergence (or until maxiter steps) |
eps |
tolerance for convergence |
maxiter |
maximum number of iteration steps. Ignored if steps
is finite |
na.action |
a function which indicates what should happen when the data contain 'NA's. Default is to fail. |
As tyler.shape
for spatial signs and
duembgen.shape
for spatial symmetrized signs, but for
spatial ranks and signed ranks. These are the so called inner
standardization matrices of location etc. tests based on spatial signs
and ranks. When data is standardized using these matrices the
corresponding sign or rank scores will appear “uncorrelated”:
the corresponding outer standardization matrices will be proportional
to the identity matrix, see examples.
spatial.shape
is a wrapper function for a unified access to all
four shape estimates. The choice of estimate is done via score
:
"sign"
for tyler.shape
"symmsign"
for duembgen.shape
"rank"
for rank.shape
"signrank"
for signrank.shape
signrank.shape
(and tyler.shape
, thus also
spatial.shape
) requires the location vector with respect to
which it is computed. If none is provided, vector of column means is
used.
Seija Sirkia, ssirkia@maths.jyu.fi
tyler.shape
, duembgen.shape
, also spatial sign and rank covariance matrices and spatial signs and ranks
A<-matrix(c(1,2,-3,4,3,-2,-1,0,4),ncol=3) X<-matrix(rt(150,1),ncol=3)%*%t(A) signrank.shape(X) spatial.shape(X,score="sign") to.shape(A%*%t(A)) # one-step shape estimate based on spatial ranks and covariance matrix: spatial.shape(X,score="rank",init=cov(X),steps=1) # effect of inner standardization: RCov(X) RCov(X%*%t(chol(solve(rank.shape(X)))))