Computation of the generalized spatial median estimator as defined by Rao (1988).
spatial.median(x, data, subset, na.action, tol = 1e-6, maxiter = 200)
A list with class 'spatial.median'
containing the following components:
a list containing an image of the spatial.median
call that produced the object.
final estimate of the location vector.
final estimate of the scale matrix.
the log-likelihood at convergence.
the number of iterations used in the iterative algorithm.
the total number of iterations used in the inner iterative algorithm.
estimated weights corresponding to the Kotz distribution.
estimated squared Mahalanobis distances.
Generic function print
show the results of the fit.
a formula or a numeric matrix or an object that can be coerced to a numeric matrix.
an optional data frame (or similar: see model.frame
), used only if
x
is a formula. By default the variables are taken from environment(formula)
.
an optional expression indicating the subset of the rows of data that should be used in the fitting process.
a function that indicates what should happen when the data contain NAs.
the relative tolerance in the iterative algorithm.
maximum number of iterations. The default is 200.
An interesting fact is that the generalized spatial median estimator proposed by Rao (1988) is the maximum likelihood estimator under the Kotz-type distribution discussed by Naik and Plungpongpun (2006). The generalized spatial median estimators are defined as \(\hat{\bold{\mu}}\) and \(\hat{\bold{\Sigma}}\) which minimize $$ \frac{n}{2}\log|\bold{\Sigma}| + \sum\limits_{i=1}^n \sqrt{(\bold{x} - \bold{\mu})^T \bold{\Sigma}^{-1} (\bold{x} - \bold{\mu})}, $$ simultaneously with respect to \(\bold{\mu}\) and \(\bold{\Sigma}\).
The function spatial.median
follows the iterative reweighting algorithm of Naik and Plungpongpun (2006).
Naik, D.N., Plungpongpun, K. (2006). A Kotz-type distribution for multivariate statistical inference. In: Balakrishnan, N., Sarabia, J.M., Castillo, E. (Eds) Advances in Distribution Theory, Order Statistics, and Inference. Birkhauser Boston, pp. 111-124.
Rao, C.R. (1988). Methodology based on the L1-norm in statistical inference. Sankhya, Series A 50, 289-313.
cov
, LaplaceFit
z <- spatial.median(stack.x)
z
Run the code above in your browser using DataLab