Learn R Programming

meshed (version 0.2.3)

summary_list_q: Quantiles of elements of matrices in a list

Description

For a list of matrices \(\{ X^{(1)}, \dots, X^{(L)} \}\), all of the same dimension, this function computes the matrix \(\hat{X}\) with \(i,j\) entry \( \hat{X}_{i,j} = \) quantile(\( \{ X_{ i,j }^{(l)} \}_{l=1}^L \), q). This function does not run any check on the dimensions and uses OpenMP if available. This is only a convenience function that is supposed to speed up quantile computation for very large problems. The results may be slightly different from R's quantile which should be used for small problems.

Usage

summary_list_q(x, q, n_threads=1)

Value

The matrix of quantiles.

Arguments

x

A list of matrices of the same dimension.

q

A number between 0 and 1.

n_threads

integer number of OpenMP threads. This is ineffective if meshed was not compiled with OpenMP support.

Author

Michele Peruzzi michele.peruzzi@duke.edu

Examples

Run this code
# make some data into a list
set.seed(2021)
L <- 200
x <- lapply(1:L, function(i) matrix(runif(300), ncol=3)) 
quant_done1 <- summary_list_q(x, .9)

Run the code above in your browser using DataLab