getsamples: Extract matrix of samples from a 'metrosamp' object

Description Usage Arguments Details Value

View source: R/util.R

Description

Given a metrosamp object, or a list of metrosamp objects, extract the matrix of parameter samples. Optionally, also extract the log-posterior values.

Usage

1
getsamples(mcruns, thinto = NULL, includelp = FALSE)

Arguments

mcruns

A metrosamp object or a list of metrosamp objects.

thinto

Total number of samples to thin the sample array to. Many analysis operations scale as O(N) or O(N \ln N), so thinning can speed these up pretty substantially, especially for runs with poor sampling efficiency.

includelp

If true, return the log-posterior values in a list with the sample matrix.

Details

If the input is a list of metrosamp objects, then their samples are merged into a single grand matrix of results. Doing this discards the information about which samples came from which Markov chains.

Value

If includelp is FALSE, a matrix of samples, otherwise, a list with the sample matrix and the vector of log-posterior values.


JGCRI/metrosamp documentation built on Aug. 8, 2019, 10:59 p.m.