localdepth.similarity(x, y = NULL, tau, use = c("volume", "diameter"), method = c("simplicial", "ellipsoid", "mahalanobis"), type = c("exact", "approx"), nsamp = "all", nmax = 1, tol = 10^(-9), dimension=NULL, location = NULL, covariance = NULL, weight = NULL)x is a circular vector, a circular version is used. Avoid ties by wiggling the data. The function only issues a warning for ties.x, or NULL. If NULL, x is usedquantile.localdepth to evaluate tau using a quantile of the size of the objectsmethod equal to "simplicial" or "ellipsoid" allowed statistics are "volume" and "diameter". For method equal to "mahalanobis" this parameter is not used and the only available statistic is pairwise Mahalanobis' distancemethod="simplicial". See details."all", the size of all choose(NROW(x), NCOL(x)+1) objects is evaluated. Otherwise, a simple random sample with replacement of size nsamp is performed from the set of all possible objects.nsamp is not equal to all. If nmax=1 the number of searched objects can reach the number of possible objects (choose(NROW(x), NCOL(x)+1) for simplicial and ellipsoid depth)method="ellipsoid". It is the squared length of the ellipsoid semimajor axis. If dimension is NULL, it is set to NCOL(x)NULL or a numeric vector; the NCOL(x) means vector used in method equal to "mahalanobis". If NULL, apply(x, 2, mean) is usedNULL or a numeric matrix; the NCOL(x)*NCOL(x) covariance matrix used in method equal to "mahalanobis". If NULL, cov(x) is usedclass localdepth.similarity with the following components:max(localdepth)max(depth)num[1] gives the number of objects used for the evaluation of the depth similarity; num[2] is the number of objects used for the evaluation of the local depth similaritymethod="simplicial" and type="exact", membership of the points in simplices is evaluated; when type="approx", an approximate membership function is used. See references below.
C. Agostinelli and M. Romanazzi (2008). Local depth of multidimensional data. Working paper n. 3/2008, Dipartimento di Statistica, Universita' Ca' Foscari, Venezia.
R.Y. Liu, J.M. Parelius and K. Singh (1999) Multivariate analysis by data depth: descriptive statistics, graphics and inference. The Annals of Statistics, 27, 783-858.
localdepth data(cork)
tau <- quantile.localdepth(cork[,c(1,3)], probs=0.1, method='simplicial')
sim <- localdepth.similarity(cork[,c(1,3)], tau=tau, method='simplicial')
plot(hclust(d=as.dist(1-sim$localdepth/sim$max.localdepth)))
plot(hclust(d=as.dist(1-sim$depth/sim$max.depth)))
Run the code above in your browser using DataLab