summary_list_mean {meshed}R Documentation

Arithmetic mean 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 \bar{X} with i,j entry \bar{X}_{i,j} = \frac{1}{L}\sum_{ 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)

[Package meshed version 0.2.3 Index]