HR.Mest | R Documentation |
iterative algorithm that finds the affine equivariant multivariate median by estimating tyler.shape
simultaneously.
HR.Mest(X, maxiter = 100, eps.scale = 1e-06, eps.center = 1e-06,
na.action = na.fail)
X |
a numeric data frame or matrix. |
maxiter |
maximum number of iterations. |
eps.scale |
convergence tolerance for the Tyler's shape matrix subroutine. |
eps.center |
convergence tolerance for the location estimate. |
na.action |
a function which indicates what should happen when the data contain 'NA's. Default is to fail. |
The algorithm follows the idea of Hettmansperger and Randles (2002). There are, however, some differences. This algorithm has the vector of marginal medians as starting point for the location and the starting shape matrix is Tyler's shape matrix based on the vector of marginal medians and has then a location step and a shape step which are:
transforming the data as y=x V_{k}^{-\frac{1}{2}}
and
computing the spatial median \mu_y
of y using the function spatial.median
. Then
retransforming \mu_y
to the original scale \mu_{x,k+1}=\mu_y V_{k}^{\frac{1}{2}}
.
computing Tyler's shape matrix V_{k+1}
with respect to \mu_{x,k+1}
by using the function tyler.shape
.
The algorithm stops when the difference between two subsequent location estimates is smaller than eps.center
.
There is no proof that the algorithm converges.
A list containing:
center |
vector with the estimated loaction. |
scatter |
matrix of the estimated scatter. |
Klaus Nordhausen and Seija Sirkia
Hettmansperger, T.P. and Randles, R.H. (2002), A practical affine equivariant multivariate median, Biometrika, 89, 851–860.
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)
res <- HR.Mest(X)
colMeans(X)
res$center
cov.matrix/det(cov.matrix)^(1/3)
res$scatter
rm(.Random.seed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.