to_sims_major: Rearrange the dimensions of an MCMC array

Description Usage Arguments Details

View source: R/sims-arrays.R

Description

to_data_major() and to_sims_major() rearrange the dimensions of an array so that the simulations are indexed along the first dimension (data-major order) or the last (simulation-major order).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
to_sims_major(x)

## S3 method for class 'sims_array'
to_sims_major(x)

to_data_major(x)

is_sims_major(x)

## S3 method for class 'sims'
to_sims_major(x)

to_data_major.sims(x)

Arguments

x

A sims or sims_array object.

Details

Indexing the simulations in the right dimension is important when performance is critical. Data-wise operations (such as taking a linear combination of regression coefficients ) are faster when the first dimension indexes simulations. On the other hand, simulation-wise operations (such as taking the posterior mean of a quantity) are faster when the simulations are indexed along the last dimension.


lionel-/gsim documentation built on May 21, 2019, 6:41 a.m.