Description Usage Arguments Details Value Author(s) References See Also Examples
Computes the centroid of a Tukey depth-based trimmed region.
1 2 |
x |
Bivariate data as a matrix, data frame or list. If it is a matrix or data frame, then each row is viewed as one bivariate observation. If it is a list, both components must be numerical vectors of equal length (coordinates of observations). |
alpha |
Outer trimming fraction (0 to 0.5). Observations whose depth is less than |
eps |
Error tolerance to control the calculation. |
mustdith |
Logical. Should dithering be applied? Used when data set is not in general position or a numerical problem is encountered. |
maxdith |
Positive integer. Maximum number of dithering steps. |
dithfactor |
Scaling factor used for horizontal and vertical dithering. |
factor |
Proportion (0 to 1) of outermost contours computed according to a version of the algorithm ISODEPTH of Rousseeuw and Ruts (1998); remaining contours are derived from an algorithm in Rousseeuw et al. (1999). |
Dimension 2 only. Centroid trimmed mean is defined to be the centroid
of a Tukey depth-based trimmed region relative to the uniform measure. Contours
are derived from algorithm ISODEPTH by Ruts and Rousseeuw (1996) or, more
exactly, revised versions of this algorithm which appear in Rousseeuw and Ruts
(1998) and Rousseeuw et al. (1999). Argument factor
determines
which version to use. If n is the number of observations, contours of
depth ≤ factor
n/2 are obtained from the 1998 version, while
the remaining contours are derived from the 1999 version.
When the data set is not in general position, dithering can be used in the sense that random noise is added to each component of each observation. Random noise takes the form eps
times dithfactor
times U for the horizontal component and eps
times dithfactor
times V for the vertical component, where U, V are independent uniform on [-.5, 5.]. This is done in a number of consecutive steps applying independent U's and V's.
Centroid trimmed mean vector
Jean-Claude Masse and Jean-Francois Plante, based on Fortran code by Ruts and Rousseeuw from University of Antwerp.
Masse, J.C. (2008), Multivariate Trimmed means based on the Tukey depth, J. Statist. Plann. Inference, in press.
Ruts, I. and Rousseeuw, P.J. (1996), Computing depth contours of bivariate point clouds, Comput. Statist. Data Anal., 23. 153–168.
Rousseeuw, P.J. and Ruts, I. (1998), Constructing the bivariate Tukey median, Stat. Sinica, 8, 828–839.
Rousseeuw, P.J., Ruts, I., and Tukey, J.W. (1999), The Bagplot: A Bivariate Boxplot, The Am. Stat., 53, 382–387.
med
for multivariate medians and trmean
for classical-like depth-based trimmed means.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## exact centroid trimmed mean
set.seed(345)
xx <- matrix(rnorm(1000), nc = 2)
ctrmean(xx, .2)
## second example of an exact centroid trimmed mean
set.seed(159); library(MASS)
mu1 <- c(0,0); mu2 <- c(6,0); sigma <- matrix(c(1,0,0,1), nc = 2)
mixbivnorm <- rbind(mvrnorm(80, mu1 ,sigma), mvrnorm(20, mu2, sigma))
ctrmean(mixbivnorm, 0.3)
## dithering used for data set not in general position
data(starsCYG, package = "robustbase")
ctrmean(starsCYG, .1, mustdith = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.