7

Quantile for a single variable is easy to implement in R. However, it is not an easy task to quantile for multivariate data. There are several papers have been proposed to quantile for multivariate data such as Chaudhuri, P (1996), On a geometric notion of quantiles for multivariate data, Journal of the American Statistical Association 91, 862-872. The existing approaching is not easy to implement. Is there any R package can do quantiles for multivariate data? many thanks in advance

mpiktas
  • 33,140
  • 5
  • 82
  • 138
Tu.2
  • 2,627
  • 6
  • 26
  • 26
  • 4
    Some of the methods used to identify multivariate outliers can be adapted to ranking the data (often by identifying "outliers", removing them, and iterating). You might therefore have some interest in reviewing our thread at http://stats.stackexchange.com/questions/213/what-is-the-best-way-to-identify-outliers-in-multivariate-data. – whuber Feb 17 '12 at 18:32
  • Several different methods of calculating multivariate quantiles, as well as some related plotting methods, are given in the documentation for R's `depth plot` package ([pdf](https://web.archive.org/web/20171124040850/https://cran.r-project.org/web/packages/depth.plot/depth.plot.pdf)). – ritwik33 Nov 16 '18 at 17:48

3 Answers3

4

I would try here (mvnormtest, mvoutlier, mvtnorm): http://cran.r-project.org/web/views/Multivariate.html

2

Why don't you try my package cepp. It can compute PC's quantiles for you!

http://cran.r-project.org/web/packages/cepp/index.html

You need the function $evaluator$ in this package. It takes two arguments which correspond to the number of rows and columns in the data. It returns a function which can be optimized to get the spatial quantiles.

For a minimal example, see this snippet from the package documentation.

x <- rnorm(500)
dim(x) <- c(250,2)
ev <- evaluator(250,2)
##The Spatial Median
trust(ev, parinit=c(median(x[1,]), median(x[2,])), u=c(0,0),
       rinit=0.5, rmax=2e5, samp = x)
##Quantile for vector (0.2,0.3)
trust(ev, parinit=c(median(x[1,]), median(x[2,])), u=c(0.2,0.3),
       rinit=0.5, rmax=2e5, samp = x)
Mohit
  • 101
  • 3
1

You need to compute the CDF of the joint distribution f(x1,x2,...,xn). The CDF will give you the quantiles you seek.

Hidden Markov Model
  • 938
  • 1
  • 8
  • 16