D <- matrix(rnorm(2000), nrow=2, ncol=1000)
t(matrix(c(quantile(D[1,], c(0.05,0.95)), quantile(D[2,], c(0.05,0.95))), nrow=2))
I have a 2-by-1000 matrix, each of whose columns is a pair of observations of (X,Y). I want to find the same quantiles of each row. say q_0.05 and q_0.95. What is the fastest way to compute that?
Try
matrixStats::rowQuantiles
.Data: