Iterative algorithms to find spatial median, multivariate HodgesLehmann estimate of location, their affine equivariant versions and kstep versions of these.
1 2 3 4 5 6 7 8 9  spatial.location(X, score = c("sign", "signrank"), init = NULL,
shape = TRUE, steps = Inf, maxiter = 500, eps = 1e6,
na.action = na.fail)
ae.spatial.median(X, init = NULL, shape = TRUE, steps = Inf,
maxiter = 500, eps = 1e6, na.action = na.fail)
ae.hl.estimate(X, init = NULL, shape = TRUE, steps = Inf,
maxiter = 500, eps = 1e06, na.action = na.fail)

X 
a matrix or a data frame 
score 
a character string indicating which transformation of the observations should be used 
init 
an optional vector giving the initial point of the iteration 
shape 
logical, or a matrix. See details 
steps 
fixed number of iteration steps to take, if 
eps 
tolerance for convergence 
maxiter 
maximum number of iteration steps 
na.action 
a function which indicates what should happen when the data contain 'NA's. Default is to fail. 
Spatial median and HodgesLehmann estimator (spatial median of the pairwise differences) are not affine equivariant. Affine
equivariance can be achieved by simultaneously estimating the
corresponding shape, as proposed for the spatial median by
Hettmansperger and Randles (2002). For spatial median the corresponding
shape is signs.shape
and for the HodgesLehmann estimate it
is signrank.shape
.
spatial.location
is a wrapper function for a unified access to
both location estimates. The choice of estimate is done via
score
:
"sign"
for spatial median
"signrank"
for HodgesLehmann estimate
If a matrix (must be symmetric and positive definite, but this is not
checked) is given as shape
the location estimate is found with
respect to that shape and no further shape estimation is done. If a
logical TRUE
is given as shape
the shape is estimated
and consequently the affine equivariant version of the location
estimate is found. If shape
is FALSE
then shape
estimation is not done and the non affine equivariant versions of the
location estimate, that is the spatial median and the HodgesLehmann estimate are found.
The estimate vector with the (final estimate of or given) shape matrix
as attribute "shape"
.
Seija Sirkia, seija.sirkia@iki.fi, Jari Miettinen, jari.p.miettinen@jyu.fi
Hettmansperger, T. and Randles, R. (2002) A Practical Affine Equivariant Multivariate Median, Biometrika, 89, pp. 851860
spatial.median
, signrank.shape
1 2 3 4 5 6 7 8  A<matrix(c(1,2,3,4,3,2,1,0,4),ncol=3)
X<matrix(rnorm(3000),ncol=3)%*%t(A)
spatial.location(X,score="signrank")
spatial.location(X,score="sign")
#compare with:
colMeans(X)
ae.hl.estimate(X,shape=A%*%t(A))
ae.hl.estimate(X,shape=FALSE)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.