extract_n_combine: Extract parameters into a long array from stanfit object

View source: R/extract_n_combine.R

extract_n_combineR Documentation

Extract parameters into a long array from stanfit object

Description

Extracts MCMC samples stored in a stanfit objects and creats an array which combines posterior samples across the MCMC chains *without* permuting the indices, *excluding* the warmup phase, and returning an object with the first dimension equal to the number of saved posterior samples and the other dimensions equal to those specified in the original Stan program (e.g., if parameter x was specified as matrix[K,K], the resulting array will have dimensions S\*K\*K, where S is the number of post-warmup posterior samples.)

Usage

extract_n_combine(fit, par)

Arguments

fit

a stanfit object

par

parameter to extract

Value

the function returns an array of the extracted samples


baruuum/relabelKL documentation built on Feb. 1, 2024, 12:23 a.m.