Library: | robtech |
See also: | median simdep |
Quantlet: | mve | |
Description: | Computes the minimum volume ellipsoid estimate of location |
Usage: | z = mve(x{, cutoff}) | |
Input: | ||
x | n x p matrix (n observations of dimension p) | |
cutoff | an optional scalar defining the threshold for rejection of observations; by default, it equals 0.975 quantile of the chi-square distribution with n degrees of freedom | |
Output: | ||
z.mve | p x 1 vector containing the estimate of location | |
z.mdist | n x 1 vector containing Mahalanobis distances for all observations | |
z.rdist | n x 1 vector containing robust distances for all observations | |
z.weights | n x 1 vector containing 0 (for observations that have their robust distance greater then "cutoff", i.e., they are too far from the center of the data) or 1 (otherwise) | |
z.matcov | p x p robust covariance matrix | |
z.matcor | p x p robust correlation matrix |
library("robtech") ; ; simulate data ; randomize(101) x = #(uniform(98),10,100) ; ; estimate the location by mve ; z = mve(x) z.mve ; estimate the location by median and mean ; median(x) mean(x)
Contents of mve [1,] 0.48199 Contents of med [1,] 0.49727 Contents of mean [1,] 1.5723
library("robtech") ; ; simulate data ; randomize(1) x = uniform(100,2)|(2*(uniform(20,2)-0.5)) ; ; estimate the location by mve ; z = mve(x) z.mve ; ; draw a depth graph and median ; d = createdisplay(1,1) dat = x col = z.weights setmaskp(dat, col, 3, 8) est = z.mve' setmaskp(est,4,12,15) ; mve is red big star show(d, 1, 1, dat, est) setgopt(d, 1, 1, "title", "Minimum volume ellipsoid")
There are two types of output. First, in the output window, the following estimate appears: Contents of mve [1,] 0.47337 [2,] 0.40312 Moreover, there is also a graph showing the minimum volume ellipsoid estimate as a big read star and all data points as blue and black circles. The black point are the rejected ones, that is those considered too distant from the main bunch of the data.