mcmc2list: Convert mcmc.list posterior to list

View source: R/mcmc2list.R

mcmc2listR Documentation

Convert mcmc.list posterior to list

Description

Convert 'mcmc.list' posterior to named list of vectors or arrays.

Usage

mcmc2list(x, pars, collapse.chains = TRUE)

Arguments

x

object of class mcmc.list.

pars

vector of parameter names to extract.

collapse.chains

return array with dimension for each chain?

Note

If collapse.chains = TRUE, the last dimension of arrays will always be samples from the posterior. If collapse.chains = FALSE, the last dimension of arrays will be individual chains, and the one prior to that will be samples from the posterior for each chain.

See Also

aperm to transpose the array if necessary. as.data.frame.table to convert arrays to data.frames.


swfscMisc documentation built on April 3, 2025, 6:08 p.m.