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
locked by whuber♦ Nov 16 '18 at 18:32
This question exists because it has historical significance, but it is not considered a good, on-topic question for this site so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. See the help center for guidance on writing a good question.
Read more about locked posts here.
I would try here (mvnormtest, mvoutlier, mvtnorm): http://cran.r-project.org/web/views/Multivariate.html
Why don't you try my package cepp. It can compute PC's quantiles for you!
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)
You need to compute the CDF of the joint distribution f(x1,x2,...,xn). The CDF will give you the quantiles you seek.