spatial.median {ICSNP} | R Documentation |
Spatial Median
Description
iterative algorithm to compute the spatial median.
Usage
spatial.median(X, init = NULL, maxiter = 500, eps = 1e-06,
print.it = FALSE, na.action = na.fail)
Arguments
X |
a numeric data frame or data matrix. |
init |
Starting value for the alogrihtm, if 'NULL', the vector of marginal medians is used. |
maxiter |
maximum number of iterations. |
eps |
convergence tolerance. |
print.it |
logical. If TRUE prints the number of iterations, otherwise not. |
na.action |
a function which indicates what should happen when the data contain 'NA's. Default is to fail. |
Details
Follows the algorithm of Vardi and Zhang.
Value
vector of the spatial median.
Author(s)
Klaus Nordhausen and Seija Sirkia
References
Vardi, Y. and Zhang, C.-H. (1999), The multivariate L1-median and associated data depth, PNAS, 97, 1423–1426.
Examples
set.seed(654321)
cov.matrix <- matrix(c(3,2,1,2,4,-0.5,1,-0.5,2), ncol=3)
X <- rmvnorm(100, c(0,0,0), cov.matrix)
spatial.median(X)
rm(.Random.seed)
[Package ICSNP version 1.1-2 Index]