summary_list_mean: Arithmetic mean of matrices in a list

View source: R/RcppExports.R

summary_list_meanR Documentation

Arithmetic mean of matrices in a list

Description

For a list of matrices \{ X^{(1)}, …, X^{(L)} \}, all of the same dimension, this function computes the matrix \bar{X} with i,j entry \bar{X}_{i,j} = \frac{1}{L}∑_{ l=1 }^{L} X_{ i,j }^{(l)} . This function does not run any check on the dimensions and uses OpenMP if available.

Usage

summary_list_mean(x, n_threads=1)

Arguments

x

A list of matrices of the same dimension

n_threads

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

Value

The matrix of mean values.

Author(s)

Michele Peruzzi michele.peruzzi@duke.edu

Examples

# make some data into a list
set.seed(2021)
L <- 200
x <- lapply(1:L, function(i) matrix(runif(300), ncol=3)) 
mean_done <- summary_list_mean(x)

meshed documentation built on Sept. 20, 2022, 1:06 a.m.